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 | b2385db8963cebbdebff7333e33f740594ea9dc6 (patch) | |
tree | 1fe998838191d0e0550dc8fa744459937f2ee90e /ext/bigdecimal | |
parent | 923044bba260830d7c698fe4dd18f35671df966a (diff) |
Bug fix: '-' should not be counted as a digit(to_s(n) format).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-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 e850fbd047..854756b4ee 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) { |