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 xe 提权代码

Delphi 如何判断某一窗口最大化

Delphi append 追加内容到文件中

Delphi vcl 在trichedit控件中设置wordwrap属性后无法自动换行的问题

Delphi winapi: settimer、killtimer - 创建与移除高性能定时器

Delphi 关于位图的像素格式

Delphi在memo按键实现全选

Delphi 对话框单元

Delphi 用firedac处理sqlite的日期型

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



打赏

取消

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

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

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

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

评论

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