Disappearing decimals... please help!

Maybe it’s all in my head, but I’m having the strangest little issue
ever. My pricetags in my rails app are always whole numbers. Rails seems
to completely ignore my decimal input. So as a consequence, 10.41
becomes 10.00, always.

Here’s some worthwhile stuff:

within my 004_create_products.rb file:

:price, :decimal, :percision => 2, :default => 0

And calling the product price in a view:

<%= number_to_currency(product.price, {:precision => 2}) %>

That’s all I can really think of that could be of help. Is this all in
my head, or am I retarded and missing something?

As stated in previous reply, make sure your migration is right. You
can also verify the precision in the db tables.

James M.

I’m hoping that you just made a simple copy/paste error on that

:price, :decimal, :percision => 2, :default => 0


James M.

On 11/27/07, Cade D. [email protected] wrote:

:price, :decimal, :percision => 2, :default => 0

You’re asking for a column with two significant digits and don’t
mention that you want decimal places.