Skip to content

Commit

Permalink
Fix JRUBY-6428 (also JRUBY-6632 by extension).
Browse files Browse the repository at this point in the history
Convert the argument to a Float, so that conversion to String is possible.
  • Loading branch information
BanzaiMan committed Jul 28, 2012
1 parent b9e669b commit 2c12e33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/jruby/ext/bigdecimal/RubyBigDecimal.java
Expand Up @@ -440,7 +440,7 @@ public static RubyBigDecimal newInstance(IRubyObject recv, IRubyObject[] args) {
if (args.length == 0) {
decimal = new BigDecimal(0);
} else {
String strValue = args[0].convertToString().toString();
String strValue = args[0].convertToFloat().asString().toString();
strValue = strValue.trim();
if ("NaN".equals(strValue)) {
return newNaN(runtime);
Expand Down

0 comments on commit 2c12e33

Please sign in to comment.