That's a good one, too.
It would otherwise take...
Pete
It would otherwise take...
Code: (Select All)
FUNCTION roundDP$ (num, digits) ' fixed with sgn 2022-11-08
DIM s$, dot
SELECT CASE num
CASE IS < 0
s$ = _TRIM$(STR$(num - .5 * 10 ^ -digits))
CASE 0
s$ = _TRIM$(STR$(num * 10 ^ -digits))
CASE IS > 0
s$ = _TRIM$(STR$(num + .5 * 10 ^ -digits))
END SELECT
dot = INSTR(s$, ".")
IF dot THEN roundDP$ = MID$(s$, 1, dot + digits) ELSE roundDP$ = s$
END FUNCTION
Pete