It seems that the
Int()-function is rather unknown to most programmers.
Delphi-Quellcode:
Function RoundedReal(n:Double; decimalplaces:Integer):Double;
var multi:Double;
begin
Assert(decimalplaces >=0);
multi := IntPower(10, decimalplaces);
Result := Int(n * multi) / multi;
end;