Przeglądaj źródła

* fixed mantis #10519 (when rounding for the first decimal digit and
it is at the same time the last, append the 0)

git-svn-id: trunk@9623 -

Jonas Maebe 17 lat temu
rodzic
commit
337e53e712
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8 1
      rtl/inc/real2str.inc

+ 8 - 1
rtl/inc/real2str.inc

@@ -385,7 +385,14 @@ begin
               roundStr(temp,spos);
               d := frac(d+roundCorr);
               if (f < 0) then
-                dec(currprec);
+                begin
+                  dec(currprec);
+                  if (currprec=0) then
+                    begin
+                      inc(spos);
+                      temp[spos]:='0';
+                    end;
+                end;
             end;
           { calculate the necessary fractional digits }
           for fracCount := 1 to currPrec do