From: "Bartosz DziewoƄski" Date: 2012-04-14T06:46:51+09:00 Subject: Re: Why doesn't Fixnum#to_d exist? It does exist, but it's in a separate file - bigdecimal/util or utils, if I remember correctly. (I'm on my mobile, can't check.) 2012/4/13, Mark Campbell : > http://stdlib.rubyonrails.org/libdoc/bigdecimal/rdoc/index.html > >> String# >> to_d ... to BigDecimal >> >> Float# >> to_d ... to BigDecimal >> >> Rational# >> to_d ... to BigDecimal > > These all exist... why not for Fixnum#to_d? Right now I'm having to write a > mixin on Fixnum, something like this: > > class Fixnum > def to_d > BigDecimal(self.to_s) > end > end > > The above code is *very* similar to what has been written for Float and > String. > > Is there a reason why this doesn't exist on Fixnum? I'm currently using > 1.8.7. > -- -- Matma Rex