Doctrine 2 - 2 decimal places on a float?
Both precision
and scale
properties work only with the decimal
mapping type (link). I suggest you use the decimal
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.
/** * @ORM\Column(type="float", scale=2) */protected $curr_price;
scale should be an integer, and you are using a string