Description
Description
Currently scalar numeric values are passed directly to the Encoders
which is then formatted into string:
symfony/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php
Lines 463 to 464 in 3711a6a
for the xml i am working on, i would like to have the floating points fixed, so it can be serialized into:
<element>12.50</element>
instead of this:
<element>12.5</element>
my current tests for my library using Serializer does read the XML into Objects and writes them back into XML again and compares the XML-Strings. These differences currently make the Tests fail.
because this might depend on the properties, it might need to be done in AbstractObjectNormalizer too:
The ScalarNormalizer might need to be format specific, like it should only do Numeric to FormatString for XML, not for JSON
Example
No response