把5.1变成5

解决方案 »

  1.   

    function 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.   

    function Trunc(X: Extended): Int64;
      

  3.   

    有人在这里贴过Delphi的函数大全,你应该找一下,很有用的,象这样的问题也就在手头边上就有答案了!
      

  4.   

    trunce() 直接截掉小数位
    ceil ()   望大的整数取整 如 2.13 -> 3  , -2.13 -> -2
    floor ()  与上相反