Hi All,

I created  a new Expense item. In particular, the value I entered in
the Amount field was 14.99.  In the scaffold invocation for this
field, I declared its type to be Decimal.

The log for the creation of this expense record shows
"amount"=>"14.99"

But log for the SQL statement shows:
Create (16.0ms) [0m    [0mINSERT INTO `expenses` (`purpose`, `by`,
`updated_at`, `date`, `type`, `amount`, `vendor`, `created_at`)
VALUES('fun', 'RLM', '2010-03-12 22:11:24', '2010-03-12', NULL, 14,
'Ringling Bros', '2010-03-12 22:11:24')
So the amount has been converted to an integer with the decimal
portion of the input truncated.

What’s the best way to resolve this problem?

Thanks in Advance,
Richard

-- 
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-t...@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