Navigation Menu

Skip to content

paulca/big_decimal_price

Repository files navigation

BigDecimal Price

Did you know that decimal columns are great for storing prices in Rails apps?

Well, they are.

This little gem ensures that if you have, say a price column on a database, when you call that price method on your model, it will come out formatted like a price.

eg.

<%= @item.price %>

will out put 10.90, even if the decimal value is 10.9

Installation

Just add this to your gemfile:

gem 'big_decimal_price'

Lovely.

== Copyright

Copyright (c) 2011 Paul Campbell. See LICENSE.txt for further details.

About

BigDecimal.new('10.9').to_s #=> '10.90'

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages