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之autorun(复制自身+循环扫描)

Delphi 掌控pagecontrol中的右上方的左右箭头事件

Delphi 随机函数单元urandomutils

Delphi 泛型排序器 tcomparer

Delphi xe10 手机端错误提示:detected problems with api compatibility (visit g.co/dev/appcompat for more info

datasnap 上传/下载大文件(本demo以图传片文件为例)

Delphi编程时按回车键无效,无法换行解决办法

Delphi 的 webservice 的 cookie 操作

Delphi 提取字符中的数字

Delphi datasnap 2009的简单使用

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



打赏

取消

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

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

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

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

评论

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