class BigDecimal
def to_d
d.to_d # => 0.314e1
d = BigDecimal("3.14")
require 'bigdecimal/util'
Returns self.
a.to_d -> bigdecimal
call-seq:
def to_d self end
def to_digits
d.to_digits # => "3.14"
d = BigDecimal("3.14")
require 'bigdecimal/util'
This method is deprecated; use BigDecimal#to_s("F") instead.
Converts a BigDecimal to a String of the form "nnnnnn.mmm".
a.to_digits -> string
call-seq:
def to_digits if self.nan? || self.infinite? || self.zero? self.to_s else i = self.to_i.to_s _,f,_,z = self.frac.split i + "." + ("0"*(-z)) + f end end