views:

39

answers:

2

I've been looking all over, and really just need a definitive answer to ride on. I'm going to have an object that contains percentages compiled from other objects, the point here is, what's the standard for representing a percentage in rails, without it getting broken in data migrations and things like that.

+1  A: 

If you use :decimal as the type, they'll get converted into BigDecimals. Be sure to specify :precision and :scale in your migration, lest Rails decide that you really wanted an integer instead.

Pesto
A: 

I use :float often and works without problem for me.

Swanand