Explorar el Código

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 hace 5 años
padre
commit
eefcab9cbc
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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;