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.
function LimitDecimals(f : Extended; Decimals : Integer) : Extended;
begin
Result := Round(f* Power(10, Decimals)) / Power(10, Decimals);
end;
function LimitDecimals(f : Extended; Decimals : Integer) : Extended;
begin
Result := Trunc(f* Power(10, Decimals)) / Power(10, Decimals);
end;
I like the Format method. You could also use FloatToStrF.
var float: double;
var posi: integer;
begin
float := 29.4997647058824;
//find the point
posi := pos('.', floattostr(float));
//copy from start to 1 more than point
caption := copy(floattostr(float),0,posi+1);
end;