Browse Source

* fixed web bug #7105

git-svn-id: trunk@5068 -
Jonas Maebe 19 years ago
parent
commit
117774e006
3 changed files with 21 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 1 0
      rtl/inc/real2str.inc
  3. 19 0
      tests/webtbs/tw7105.pp

+ 1 - 0
.gitattributes

@@ -7547,6 +7547,7 @@ tests/webtbs/tw7006.pp svneol=native#text/plain
 tests/webtbs/tw7071.pp svneol=native#text/plain
 tests/webtbs/tw7100.pp svneol=native#text/plain
 tests/webtbs/tw7104.pp svneol=native#text/plain
+tests/webtbs/tw7105.pp svneol=native#text/plain
 tests/webtbs/tw7143.pp -text
 tests/webtbs/tw7161.pp svneol=native#text/plain
 tests/webtbs/tw7195.pp svneol=native#text/plain

+ 1 - 0
rtl/inc/real2str.inc

@@ -384,6 +384,7 @@ begin
             begin
               roundStr(temp,spos);
               d := frac(d);
+              dec(currprec);
             end;
           { calculate the necessary fractional digits }
           for fracCount := 1 to currPrec do

+ 19 - 0
tests/webtbs/tw7105.pp

@@ -0,0 +1,19 @@
+var i:integer;
+    H:single;
+    s:string;
+
+begin
+  H:= 10;
+  for i:=1 to 25 do
+    begin
+      str(H:8,s);
+      if (s[1] <> ' ') or
+         (length(s) <> 8) then
+        begin
+          writeln(s);
+          halt(1);
+        end;
+      H:= H / 10.0;
+    end;
+end.
+