
Delphi 10.3 四舍五入函数
发布日期:2021-05-04 20:44:45
浏览次数:16
分类:技术文章
本文共 538 字,大约阅读时间需要 1 分钟。
//四舍五入函数function frmBS1.RoundIt(work: double): double;begin //Round .5 up always.//Currency fields are stored with 4 decimals, so need to be rounded to 2 decimals when multiplying by exchange rates, etc.//example: frmBS1.RoundIt(amount * rate * 100)/100; if work >0 then begin if Int(work + 0.5) > Int(work) then result := Int(work) + 1 else result := Int(work); end else begin if Int(work - 0.5) < Int(work) then result := Int(work) - 1 else result := Int(work); end;end;
发表评论
最新留言
哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年03月20日 01时51分15秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
如何在Mac上关闭Siri?
2019-03-03
修复苹果Mac中的快速视频播放错误的方法
2019-03-03
MAC电脑Command键调换为Control键的方法
2019-03-03
苹果HomePod智能音箱怎么使用广播功能?
2019-03-03
Mac系统投屏到电视机的方法
2019-03-03
【Docker&ARM】ARM架构服务器上docker的安装
2019-03-03
【Tinyproxy】CentOS7.X http代理tinyproxy的安装配置与使用
2019-03-03
【python3】CentOS7.x上Python3.8.3的编译安装
2019-03-03
python insert插入mysql 中文字符报错 及mysql编码介绍
2019-03-03
php-foreach遍历一维数组
2019-03-03
php--自定义错误处理函数的使用方法
2019-03-03
php--异常处理主动抛出异常的使用方法
2019-03-03
php--简易的相册1
2019-03-03
php---xml基础知识
2019-03-03
php--class static
2019-03-03
php--匿名函数的使用
2019-03-03
php--json_decode
2019-03-03
php--class的工厂模式的示例
2019-03-03
php--模拟调用接口的代码
2019-03-03
php教程--案例20(用户登录)
2019-03-03