I have a column in my table with DECIMAL(19,4)
and I'm creating my Entity for a project, what is the right way to define this field? What precision and scale parameters means in Doctrine Annotations?
The precision is the number of digits in the number. For example, 123456.78 has a precision of 8.
Scale is the is the maximum number of decimal places. 123456.78 has a scale of 2.
DECIMAL(19,4)
would allow 19 total digits, with four decimal places.
The annotation for that would be:
@Column(type="decimal", precision=19, scale=4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With