trunc()取整
round()四舍五入

解决方案 »

  1.   

    unction Trunc(X: Extended): Int64;DescriptionThe Trunc function truncates a real-type value to an integer-type value. X is a real-type expression. Trunc returns an Int64 value that is the value of X rounded toward zero.If the truncated value of X is not within the Int64 range, an EInvalidOp exception is raised.
      

  2.   

    trunc()取整数
    round()四舍五入
      

  3.   

    function Round(const X: Extended): Extended;
    var
      I: Double;
    begin
      Result := Int(X);
      I := Frac(X);
        if I >= 0.5  then
          Result := Result + 1;
    end
      

  4.   

    trunc()取整数
    round()四舍五入