瀏覽代碼

Fix RoundTo bug in FPC caused by invalid arithmetic type

Solution is to previously calculate as a Double and then assign to a Currency as expected
PascalCoin 5 年之前
父節點
當前提交
eefcab9cbc
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/core/UAccounts.pas

+ 4 - 1
src/core/UAccounts.pas

@@ -1547,8 +1547,11 @@ begin
 end;
 
 class function TAccountComp.FormatMoneyDecimal(Money : Int64) : Currency;
+var Ltmp : Double;
 begin
-  Result := RoundTo( Money / 10000.0, -4);
+  Ltmp := Money;
+  Ltmp := Ltmp / 10000.0;
+  Result := RoundTo( Ltmp , -4);
 end;
 
 class function TAccountComp.GetECInfoTxt(const EC_OpenSSL_NID: Word): String;