; FAQ 2225: Rounding Formula Expressions $RND and $ROUND

FAQ 2225: Rounding Formula Expressions $RND and $ROUND

Problem:

Please explain the difference between the $RND and $ROUND commands.


Solution:

The $RND function can be a bit tricky, as the number that you input after the semicolon is not the number of decimal
places that you want, but rather the number that 10 should be raised to before it is divided into the first expression and
then rounded to the nearest whole number. When using that function, start with $RND;0, (to get xxxx.xx example write $rnd(comp;0) then increase the number if you want less decimal places and decrease it if you want more.
$rnd(comp;-1) = xxxx.xxx
$rnd(comp;1)= xxxx.x

$Rnd(comp;0) = $ROUND(comp;2)
Our logical minds think differently and so for this reason we added the $ROUND function, in which you specify how many decimal places you need. If you code your formula with $ROUND;2, you should get the result such as 2.00 with the 2 places after the decimal.