소스 검색

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;