When not providing the decimal argument in NumberFormatter::format, it tries to determine the decimals from the stringified $number argument.
For this it uses the locale to find the decimal separator.
As the comment states // This is needed because (string)$number uses the locale's decimal separator.
This is no longer true since php 8.0. https://php.watch/versions/8.0/float-to-string-locale-independent.
This issue causes e.g. the Price element to lose any decimals in case a locale with a comma decimal separator is used.
It seems this is the case since version 2.0.3.
When not providing the decimal argument in
NumberFormatter::format, it tries to determine the decimals from the stringified$numberargument.For this it uses the locale to find the decimal separator.
As the comment states
// This is needed because (string)$number uses the locale's decimal separator.This is no longer true since php 8.0. https://php.watch/versions/8.0/float-to-string-locale-independent.
This issue causes e.g. the Price element to lose any decimals in case a locale with a comma decimal separator is used.
It seems this is the case since version 2.0.3.