diff options
Diffstat (limited to 'ext/bigdecimal/lib/bigdecimal/util.rb')
-rw-r--r-- | ext/bigdecimal/lib/bigdecimal/util.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb index 6e1697be88..6860cfd702 100644 --- a/ext/bigdecimal/lib/bigdecimal/util.rb +++ b/ext/bigdecimal/lib/bigdecimal/util.rb @@ -54,6 +54,14 @@ class BigDecimal < Numeric i + "." + ("0"*(-z)) + f end end + + # call-seq: + # a.to_d -> bigdecimal + # + # Returns self. + def to_d + self + end end class Rational < Numeric |