Label1.Caption:= CurrTostr(strTocurr(Label2.Caption)/strTocurr(Label3.Caption));
uj5u.com熱心網友回復:
Label1.Caption := Format('%0.2f', [strTocurr(Label2.Caption) / strTocurr(Label3.Caption)]);uj5u.com熱心網友回復:
Format格式化:Format('this is %n',[4552.2176]);
回傳的是this is 4,552.22
你可以使用:
Label1.Caption := Format('%n', [strTocurr(Label2.Caption) / strTocurr(Label3.Caption)]);
uj5u.com熱心網友回復:
1、顯示也可以采用:FormatFloat 也可以
如:FormatFloat('0.00',123.456);
輸出 123.45
2、如果為了存值,可以用 Round 或者 Trunc (值 * 100) /100,如:
double v = Round(floatValue * 100)/100;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/168234.html
標籤:語言基礎/算法/系統設計
上一篇:制作word插件(把我的程式嵌入到word的選單欄)
下一篇:<table> tr 洗掉
