Permalink
Browse files

Ensure BigDecimal.new always receives a string - compatibility fix fo…

…r ruby-1.9.2-p320
  • Loading branch information...
1 parent 912c023 commit 1e5a5383b810f736becc54e2521691405c06ead5 Robert Starsi committed Dec 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/money/money.rb
View
@@ -29,7 +29,7 @@ def fractional
# @fractional can end up being set to a Float. We need to ensure
# it is BigDecimal before calling #round with two paramers.
# Float class only provides #round with 0 or 1 parameter.
- BigDecimal.new(@fractional, 0).round(0, self.class.rounding_mode).to_i
+ BigDecimal.new(@fractional.to_s, 0).round(0, self.class.rounding_mode).to_i
end
end

0 comments on commit 1e5a538

Please sign in to comment.