Here's an alterative that rounds to 100, but has a "mid".
If the value is 0-29 it rounds down (120 -> 100)
If the value is 30-69 it rounds mid (167 -> 150)
If the value is 70-99 it rounds up (184 -> 200)
For values of 100 or more, you could actually look at two characters and set your rounding points to 25 and 75 instead of 30 and 70.
Here's the basic idea along with the test code..
code:
$X = fnRound(1796)
"1796 : $X" ?
$X = fnRound(398)
" 398 : $X" ?
$X = fnRound(702)
" 702 : $X" ?
$X = fnRound(746)
" 746 : $X" ?
$X = fnRound(452)
" 452 : $X" ?
Function fnRound($VAL)
$RND = 100
$fnRound = ($VAL / $RND) * $RND
$T = Val(Left(cStr($VAL - $fnRound), 1))
Select
Case $T > 7 ; greater than 7 - round up
$fnRound = $fnRound + $RND
Case $T > 3 ; greater than 3, less than 7, round mid
$fnRound = $fnRound + ($RND / 2)
EndSelect
EndFunction
_________________________
Actually I
am a Rocket Scientist!