From: Roger Pack on

> 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
--
Posted via http://www.ruby-forum.com/.

From: Diogo Almeida on
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/.