Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (24 sloc) 1.046 kb
= dollars_and_cents plugin for Rails
A transparent handler for storing monetary values as integer fields in a
== Installation
If your project is source-controlled by Subversion (which it should be, really),
the easiest way to install this is via Rails' plugin script:
./script/plugin install -x
If you're not using Subversion, or if you don't want it adding
<tt>svn:externals</tt> in your project, remove the <tt>-x</tt> switch:
./script/plugin install
== Usage
In this example, let's assume we have a price we need to store in our database.
1. Create a database field named +price_in_cents+, of type +INTEGER+.
2. Access the price as follows:
@product.price #=> 29.99
@product.price = 24.99 #=> 24.99
@product.price #=> 24.99
== Resources
=== Subversion
=== Blog
== Credits
Written by Coda Hale <>.
Jump to Line
Something went wrong with that request. Please try again.