From 18f432bdfe27abeb46abc7e72c618fd6ccc6c7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Thu, 23 May 2024 21:08:01 +0200 Subject: [PATCH] Added parenthesis in TBigInt.ToString for negative values --- UBigInt.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UBigInt.pas b/UBigInt.pas index cd2fb7c..a672b9a 100644 --- a/UBigInt.pas +++ b/UBigInt.pas @@ -532,7 +532,7 @@ var i: Integer; begin if FIsNegative then - Result := '-' + Result := '(-' else Result := ''; for i := 0 to Length(FDigits) - 2 do @@ -540,6 +540,8 @@ begin Result := Result + IntToStr(FDigits[Length(FDigits) - 1]); for i := 0 to Length(FDigits) - 2 do Result := Result + ')'; + if FIsNegative then + Result := Result + ')' end; class function TBigInt.FromInt64(const AValue: Int64): TBigInt;