https://wiki.oberon.org/ob/o7/example/inttostring
PROCEDURE RealToString (x: REAL; VAR s: ARRAY OF CHAR); VAR i, j, p: INTEGER; a: ARRAY 32 OF CHAR; BEGIN IntToString(FLOOR(x), s); i := 0; WHILE s[i] # 0X DO INC(i) END; s[i] := "."; INC(i); p := FLOOR(x*100.0) MOD 100; IF p = 0 THEN s[i] := "0"; INC(i); s[i] := "0"; INC(i) ELSE IntToString(p, a); j := 0; WHILE a[j] # 0X DO INC(j); END; IF j = 1 THEN s[i] := "0"; INC(i) END; j := 0; WHILE a[j] # 0X DO s[i] := a[j]; INC(j); INC(i) END; END; s[i] := 0X; END RealToString;