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've noticed that NumberFormatter underwent some changes from 0.* tot 1.*. More specifically the percent style got some breaking changes. I'm just curious if the following ones are intended.
// version 0.*$formatter->format(75, ['style' => 'percent']); // 75%// version 1.*$formatter->format(75, ['style' => 'percent']); // 7500%
// version 0.*$formatter->format(0.75, ['style' => 'percent']); // 0.75%// version 1.*$formatter->format(0.75, ['style' => 'percent']); // Exception (floats cannot be passed)$formatter->format('0.75', ['style' => 'percent']); // 75%
The text was updated successfully, but these errors were encountered:
Propaganistas
changed the title
NumberFormatter percent style not accepting float
NumberFormatter percent style breaking changes
Jun 6, 2018
Everything except the Exception was done intentionally to sync the formatter with php's NumberFormatter (which formats percentages the same way). See #67.
The float exception is a regression caused by adding rounding, since rounding always requires a string (bcmath). But we can cast to string before then.
I've noticed that
NumberFormatter
underwent some changes from0.*
tot1.*
. More specifically the percent style got some breaking changes. I'm just curious if the following ones are intended.The text was updated successfully, but these errors were encountered: