Permalink
Browse files

Fix JRUBY-6428 (also JRUBY-6632 by extension).

Convert the argument to a Float, so that conversion to String is possible.
  • Loading branch information...
1 parent b9e669b commit 2c12e33f65900c973fe8d49ad1019ef6c92b252d @BanzaiMan BanzaiMan committed Jul 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/org/jruby/ext/bigdecimal/RubyBigDecimal.java
@@ -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);

0 comments on commit 2c12e33

Please sign in to comment.