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.
I have a hard time remembering these options, and I always end up here. Thanks
I always mix these two up .. thanks for reminding!
Are there default values for precision and scale?
I believe if you don’t specify the values then the database’s defaults are used, in the case of MySQL, which is DECIMAL(10,0), where 10 is the precision and 0 is the scale.
I haven’t tested this though…
Thanks. The post was very helpful.