Selaa lähdekoodia

* fixed tstrreal3, hopefully didn't break anything else

git-svn-id: trunk@4949 -
Jonas Maebe 19 vuotta sitten
vanhempi
commit
961667784a
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      rtl/objpas/sysutils/sysstr.inc

+ 7 - 1
rtl/objpas/sysutils/sysstr.inc

@@ -1015,7 +1015,7 @@ End;
 
 
 const
 const
 {$ifdef FPC_HAS_TYPE_EXTENDED}
 {$ifdef FPC_HAS_TYPE_EXTENDED}
-  maxdigits = 15;
+  maxdigits = 18;
 {$else}
 {$else}
   maxdigits = 14;
   maxdigits = 14;
 {$endif}
 {$endif}
@@ -1073,6 +1073,12 @@ Begin
             end
             end
         else if (P<>0) then // we have a decimalseparator
         else if (P<>0) then // we have a decimalseparator
           begin
           begin
+            if (Length(Result) > Precision + 1) and
+               (Precision + 1 > P) then
+              begin
+                P := Precision + 1;
+                SetLength(Result,P);
+              end;
             P := Length(Result);
             P := Length(Result);
             While (P>0) and (Result[P] = '0') Do
             While (P>0) and (Result[P] = '0') Do
               Dec(P);
               Dec(P);