Closed mathewrapid closed 4 years ago
Is there a reason to not utilize the $numberFormatter->parse($number, \NumberFormatter::TYPE_DOUBLE);
in NumberLocalizer::delocalize
?
Hello @mathewrapid,
I could reproduce the issue, I agree this is probably not the expected behavior.
Can you contribute a pull request with your proposal? I think it's the right thing to do, but this need to be reviewed by a core team member.
Thanks for your help!
Hello @mathewrapid,
I've added your issue to our board of "Wanna contribute". Feel free to contribute a patch, if you don't maybe someone from the community will take it.
Thanks for your help :)
Hi, this is not only on product value. The problem appear on the attribute too. If you try to edit an numeric attribute which allow negative value and got a negative value, the negative values are display with − and not a -
−100
and not -100
I tried to fix the problem with the solution given by @mathewrapid, but it's make some bord effect for decimal numbers :
I'm reporting a Bug
Exists in 1.6, tested even in 1.7
Use case:
-4
−4
As we can see the
-4
and−4
are not the same.The transformation happens in https://github.com/akeneo/pim-community-dev/blob/v1.7.0/src/Akeneo/Component/Localization/Localizer/NumberLocalizer.php#L45-L72
Why then is there not a "normalization" phase in the product update action in https://github.com/akeneo/pim-community-dev/blob/v1.7.0/src/Pim/Bundle/EnrichBundle/Controller/Rest/ProductController.php#L257-L298 ?