From: Diogo Almeida Date: 2010-07-15T01:08:43+09:00 Subject: Re: Ruby 1.9.2 float precision Roger Pack wrote: > >> Even though I realize that the templating engine should not be messing >> with the ruby pre-defined precisions, I would like to ask what would be >> the recommended way to get all ruby versions to behave the same? > > I think it's something like this for <= 1.9.1 > > class Float > def to_s > num = "%.12f" % self > num.sub /\.0+$/, '' > end > end Thanks Roger. I'll wait and see if the guys from shopify will accept my new assertions based on regexp, so they don't change the new behaviors introduced with the latest versions. Best regards. -- Posted via http://www.ruby-forum.com/.