Browse Source

* Fix bug in FormatFloat: missing thousand sep when no decimal separator present. Patch by Bruno Fierens

michael 5 years ago
parent
commit
9141c50a2c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/rtl/sysutils.pas

+ 2 - 0
packages/rtl/sysutils.pas

@@ -1633,6 +1633,8 @@ Begin
   if (Result<>'') and (Result[1]=' ') then
   if (Result<>'') and (Result[1]=' ') then
     Delete(Result,1,1);
     Delete(Result,1,1);
   P:=Pos('.',Result);
   P:=Pos('.',Result);
+  if (P<=0) then
+    P:=Length(Result)+1;
   Result:=ReplaceDecimalSep(Result,DS);
   Result:=ReplaceDecimalSep(Result,DS);
   Dec(P,3);
   Dec(P,3);
   if (TS<>'') and (TS<>#0) then
   if (TS<>'') and (TS<>#0) then