Title / Description
Code function MathRound(input : double; deg: byte) : extended; var mult: extended; prelastdigit : byte; tTmp, tmpResult : Int64; begin tTmp := Trunc(input * Power(10,deg+1)); prelastdigit := tTmp Mod 10; mult := Power(10,deg); if (prelastdigit < 5) then tmpResult := Trunc(input*mult) else tmpResult := Trunc(input*mult) + 1; Result := tmpResult / mult; end;
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code