delphi 小数点四舍五入问题


本文整理自网络,侵删。

 function ARoundN(v: Double; n: Integer): Double;
var
  I:Integer;
begin
  result:=v;
  for I:=0 to n-1 do
    begin
      result:=result*10;
    end;
  result:=Round(result);
  for I:=0 to n-1 do
    begin
      result:=result/10;
    end;
end;

相关阅读 >>

Delphi判断某一个点是否在一个区域内

Delphi android device information

Delphi xe10 文件目录/路径操作 (andorid、ios、windows)

Delphi xe 横屏竖屏的管理

Delphi程序带参数运行

Delphi反调试【初级】检测法

Delphi windows 编程[19] - 改变菜单项的状态: getmenustate、enablemenuitem

Delphi的万能数据库操作

Delphi 10.4.1的编译器bug终于修正了!

Delphi 10.3.2 社区版的安装

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...