Forum: Ruby on Rails Re: Re: Localized Floats

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
jmharvey.9956003 (Guest)
on 2005-11-20 01:47
(Received via mailing list)
I agree, floats aren't suited for monetary values. There's a Currency
in my plugin for that, meant to be used with the rails composed_of
The actual value is stored in the database as an integer.

It's true that
overriding to_s can break code which relies on Numerics formatting a

I don't think this will be an issue for most rails apps, and overriding
to_s makes things a lot easier. If it's a problem in a specific app, one
always disable the override.

--- removed_email_address@domain.invalid wrote:
> > I'm developing an app in german, and here in Germany our Float

> > numbers are separated by a comma instead of a dot. I.e.: 150,00
> >
instead of 150.00
> Btw:
> Floats are unsuited for monetary values and
some other things, even
> though they are often misused for it. Most of
the time it won't matter,
> but in some cases it will, therefore it's better
to do it right in the
This topic is locked and can not be replied to.