Skip to content


Rails Migrations: Decimal, Precision, and Scale

I have a tough time remembering which is which…

Precision is the total number of digits, scale is the number digits after the decimal point.

For example:

t.decimal :tax_percent, :precision => 6, :scale => 4

Would give you a total of six digits, with 4 after the decimal point.

Posted in Rails, Ruby, Tips and Tricks.

Tagged with , , , , , , .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. skiz says

    I have a hard time remembering these options, and I always end up here. Thanks :)



Some HTML is OK

or, reply to this post via trackback.