see: https://www.syntaxbomb.com/smallbasic/rounding-numbers/
The Round() command should be straightforward, but sometimes the program seems to round then add or subtract 0.00000000001 to the number, any idea why?
I compiled this to illustrate. I seem to be getting the same problem with external files. An alternative to round is using an expression like INT(100*number)/100, but it does the same.
FOR n=1 TO 100
a=100*RND
PRINT a, ROUND(a,3)
next n