mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Fix formatted, signed floats with a thousands separator after the minus sign, e.g. "-,123,456.789"
This commit is contained in:
@@ -1841,13 +1841,16 @@ end;
|
||||
}
|
||||
function FormatNumber( str: String ): String; Overload;
|
||||
var
|
||||
i, p: Integer;
|
||||
i, p, Left: Integer;
|
||||
begin
|
||||
Result := str;
|
||||
Result := StringReplace(Result, '.', DecimalSeparator, [rfReplaceAll]);
|
||||
p := Pos(DecimalSeparator, Result);
|
||||
if p = 0 then p := Length(Result)+1;
|
||||
if p > 0 then for i:=p-1 downto 2 do begin
|
||||
Left := 2;
|
||||
if (Length(Result) >= 1) and (Result[1] = '-') then
|
||||
Left := 3;
|
||||
if p > 0 then for i:=p-1 downto Left do begin
|
||||
if (p-i) mod 3 = 0 then
|
||||
Insert(ThousandSeparator, Result, i);
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user