Delphi 四舍五入含小数点函数


本文整理自网络,侵删。

 
要先 use System.Math; 然後?得?入的是extended,如果是double的?,小?滴?稻??有?`差
// MyRound 四?挝迦?
// input
// amt 金?~
// iprecision 小?滴??(?A?O0)
// ouput
// string 文字
Function MyRound(amt:extended ;iPrecision:Integer=0):String;
var
S:String;
i1:Integer;
Begin
S:= ”;
i1:= iPrecision * -1;
S:= FloatToStr(SimpleRoundTo(Amt,i1));
result := s;
End;

相关阅读 >>

Delphi 操作键盘按下和释放操作

Delphi tms web core twebsocketclient

strpcopy 将字符串复制到字符数组中

Delphi firedac操作sqlite内存数据库

Delphi xe5 android 调用手机震动(通过jobject测试是否支持震动)

Delphi cef4 忽略不安全网站

Delphi 让控制台窗口不现实出来

Delphi图像细化处理

Delphi之tstrings和tstringlists类

Delphi中利用中断获得系统启动以来的时间

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



打赏

取消

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

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

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

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

评论

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