Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// Decs: decimal places
QuickRealToStr(x : real; Decs : integer) : AnsiString;
var
IntPart : integer;
FracPart: integer;
begin
// Convert the real (float) to two integers.
IntPart := Round(Int(x));
FracPart := Round(Frac(x)));
// Take the desired decimal digits
Result := IntToStr(FracPart);
Result := Copy(Result, 1, Decs);
// Create the output string
Result := IntToStr(Int) + '.' + Result;
end;
// NOTE: Code written on the fly, may have errors.