diff options
author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-10 14:28:08 +0000 |
---|---|---|
committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-10 14:28:08 +0000 |
commit | cef83f89d5d1a3a9921359d6c6c3454c24be7cbb (patch) | |
tree | 1fe998838191d0e0550dc8fa744459937f2ee90e /ext/bigdecimal/bigdecimal.c | |
parent | b77e58e108c0269db92c435ef81920ccc77f8136 (diff) | |
download | ruby-cef83f89d5d1a3a9921359d6c6c3454c24be7cbb.tar.gz ruby-cef83f89d5d1a3a9921359d6c6c3454c24be7cbb.tar.xz ruby-cef83f89d5d1a3a9921359d6c6c3454c24be7cbb.zip |
Bug fix: '-' should not be counted as a digit(to_s(n) format).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index e850fbd04..854756b4e 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -3109,10 +3109,8 @@ VpFormatSt(char *psz,S_INT fFmt) for(i = 0; i < ie; ++i) { ch = psz[i]; if(!ch) break; - if(ch == '.') { - nf = 0; - continue; - } + if(ch=='-' || ch=='+') continue; + if(ch == '.') { nf = 0;continue;} if(ch == 'E') break; nf++; if(nf > fFmt) { |