On Jul 11, 2008, at 5:11 PM, Marcelo Barbudas wrote:
>
> Hi,
>
> Is there a rails wide solution that would show decimals like
"5.00" as
> "5" in both views and forms?
>
> I guess it would presume overwriting the BigDecimal class, but I have
> no idea how.
Not Rails wide, but just use to_i() in your views...
x = 5.00
x.to_i # -> 5
I wouldn''t recommend overriding BigDecimal''s default
display...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---