Some good replies already, but I'd add that you almost certainly want
to avoid float fields for money. They are OK for some things, but
people get twitchy when money doesn't add up exactly. You're probably
better off either using decimal fields or just storing values in
integer cents.

--Matt Jones

On Aug 24, 1:12 pm, KR <data...@gmail.com> wrote:
> Total newb here, as I've been working my way threw the tutorial, but
> doing my own thing.
> I've created a fairly simple app, that has a bunch of items.  Each
> item has 6-9 fields that have a cost associated with them (db field =
> float).  Think of each item as a car maintenance log, oil change =
> $50.00, tires = 500, breaks = 230  etc..   I want to be able to add up
> all the fields associated with the item for a grand total.
>
> I've read a lot and I"m not sure if I'm modifying the model, or coming
> up with something fancy in the controller etc..
>
> Any help with my baby steps is much appreciated.
>
> THx
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to