Classic Computer Magazine Archive COMPUTE! ISSUE 57 / FEBRUARY 1985 / PAGE 10

TI Rounding Routine
Here's a routine for TI-99/4A users that will round off decimal points to any desired place.
Bill Gardella

100 N=0
110 D$=STR$(C)
120 N=N+1
130 E$=SEG$(D$,N,1)
140 IF E$="" THEN 250
150 IF E$<>"." THEN 120
160 E$=SEG$(D$,1,N+2)
170 F$=SEG$(D$,N+3,1)
180 IF F$="" THEN 200
190 G=VAL(F$)
200 H=VAL(E$)
210 IF G<5 THEN 230
220 H=H+.01
230 C=H
240 GOTO 270
250 H=VAL(D$)
260 C=H
270 REM Rest of program from here o
    n.

Thanks for sharing the technique.