I am creating a decimal field to store a financial measure in Doctrine2 for my Symfony2 application.
Currently it looks like this:
protected $rate;
When I entered the value and the specified value was stored in the database, it was rounded to the nearest integer. I suppose I need to set the accuracy and scale types for the field, but do I need someone to explain exactly what they are doing?
The Doctrine2 documentation says:
precision: precision for the decimal (exact numeric) column (applies only to the decimal column)
scale: Scale for decimal (exact numeric) column (applies only to decimal column)
But that doesnβt tell me very much.
I assume accuracy is the number of decimal places to round to, so I assume it should be 2, but what is scale? Is the scale significant numbers?
Should my field declaration ?: -
protected $rate;
types database orm symfony doctrine2
Anonymous Feb 18 '13 at 16:13 2013-02-18 16:13
source share