Parcourir la source

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 il y a 5 ans
Parent
commit
eefcab9cbc
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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;