You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the MoneyType with the scale option set to 4.
The property is a string, using the decimal Doctrine type. And the setter on the entity accepts a string as argument.
When submitting the form & saving the entity into the database, there's always an update of the entity, even if the value has not changed (it's rounding e.g. 0.0000 to 0).
I noticed the issue disappears if I use the same form configuration, but using the NumberType instead, with the input option set to string. However, the input option of the MoneyType does not accept the string value.
I currently fixed the issue with a form extension:
Description
I use the
MoneyType
with thescale
option set to4
.The property is a
string
, using thedecimal
Doctrine type. And the setter on the entity accepts astring
as argument.When submitting the form & saving the entity into the database, there's always an update of the entity, even if the value has not changed (it's rounding e.g.
0.0000
to0
).I noticed the issue disappears if I use the same form configuration, but using the
NumberType
instead, with theinput
option set tostring
. However, theinput
option of theMoneyType
does not accept thestring
value.I currently fixed the issue with a form extension:
But I think it would be better to allow
string
for theinput
option like theNumberType
does?Example
No response
The text was updated successfully, but these errors were encountered: