浏览代码

* fix thousend separator when no decimal separator is available
* allow precision to be left away like %10.n

peter 24 年之前
父节点
当前提交
603a5be57e
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11 3
      rtl/objpas/sysstr.inc

+ 11 - 3
rtl/objpas/sysstr.inc

@@ -747,7 +747,8 @@ Var ChPos,OldPos,ArgPos,DoArg,Len : Longint;
         begin
         begin
         inc(chpos);
         inc(chpos);
         ReadInteger;
         ReadInteger;
-        If Value=-1 then DoFormaterror(feMissingArgument);
+        If Value=-1 then
+         Value:=0;
         prec:=Value;
         prec:=Value;
         end;
         end;
 {$ifdef fmtdebug}
 {$ifdef fmtdebug}
@@ -1067,7 +1068,10 @@ Begin
         Str(Value:0:Digits, Result);
         Str(Value:0:Digits, Result);
         If Result[1] = ' ' Then System.Delete(Result, 1, 1);
         If Result[1] = ' ' Then System.Delete(Result, 1, 1);
         P := Pos('.', Result);
         P := Pos('.', Result);
-        If P <> 0 Then Result[P] := DecimalSeparator;
+        If P <> 0 Then
+          Result[P] := DecimalSeparator
+        else
+          P := Length(Result)+1;
         Dec(P, 3);
         Dec(P, 3);
         While (P > 1) Do
         While (P > 1) Do
         Begin
         Begin
@@ -1228,7 +1232,11 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1.2.6  2001-07-30 10:17:50  sg
+  Revision 1.1.2.7  2001-08-01 21:45:22  peter
+    * fix thousend separator when no decimal separator is available
+    * allow precision to be left away like %10.n
+
+  Revision 1.1.2.6  2001/07/30 10:17:50  sg
   * Two moves with a string as target are now only exectuted if the number of
   * Two moves with a string as target are now only exectuted if the number of
     bytes to move is greater than 0. This prevents RTE201's when compiled
     bytes to move is greater than 0. This prevents RTE201's when compiled
     with range checks enabled.
     with range checks enabled.