Pārlūkot izejas kodu

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 gadi atpakaļ
vecāks
revīzija
eefcab9cbc
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  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;