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?
Asked
Active
Viewed 1.8k times
30
1 Answers
61
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)

Francesco Casula
- 26,184
- 15
- 132
- 131

StuBez
- 1,346
- 14
- 21