Added parenthesis in TBigInt.ToString for negative values

This commit is contained in:
Stefan Müller 2024-05-23 21:08:01 +02:00
parent cfb74da86b
commit 18f432bdfe
1 changed files with 3 additions and 1 deletions

View File

@ -532,7 +532,7 @@ var
i: Integer; i: Integer;
begin begin
if FIsNegative then if FIsNegative then
Result := '-' Result := '(-'
else else
Result := ''; Result := '';
for i := 0 to Length(FDigits) - 2 do for i := 0 to Length(FDigits) - 2 do
@ -540,6 +540,8 @@ begin
Result := Result + IntToStr(FDigits[Length(FDigits) - 1]); Result := Result + IntToStr(FDigits[Length(FDigits) - 1]);
for i := 0 to Length(FDigits) - 2 do for i := 0 to Length(FDigits) - 2 do
Result := Result + ')'; Result := Result + ')';
if FIsNegative then
Result := Result + ')'
end; end;
class function TBigInt.FromInt64(const AValue: Int64): TBigInt; class function TBigInt.FromInt64(const AValue: Int64): TBigInt;