Annotation:
/**
* @ORM\Column(type="float", scale="2")
*/
protected $curr_price;
I'm using it with Symfony 2.
And this field becomes a double in MySQL database instead of float with 2 point precision.
What am I doing wrong? I tried deleting the DB, reinserting etc...
scale should be an integer, and you are using a string
in the *.yml
Both
precision
andscale
properties work only with thedecimal
mapping type (link). I suggest you use thedecimal
type.As to why it's creating a double field instead of float, I'm not entirely sure. It probably has to do with being compatible with all supported databases. I see no mention of
double
mapping type so I assume they use the same type for both.