What would be better is to have functions trunc(), frac(), and round(). What would be even better than this, is function real_to_string(). The ultimate would be function real_to_string(), which allows the user to specify places before and after the decimal:
Code: Select all
Const A : byte = 4;
B : byte = 2;
Var C : real; Str : String[10];
Begin
C := 234.32587;
Str := Real_to_string(A,B,C);
Conversion the other way would also be nice.