-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use NumberFormatter instead of legacy NumberFormat #17006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pretty confident this is a bug in ICU, but I'll let someone else make that call. What seems to be happening behind the scenes is that ICU is taking the 64-bit integer given to it by PHP and converting it into a 32-bit integer (I assume accidentally) getting Good news is that there's a workaround: if you force the number to a float, that means it will get passed to ICU's |
Confirmed. Type hinting |
Indeed, looks like an upstream issue: But we should also read https://unicode-org.github.io/icu/userguide/format_parse/numbers/legacy-numberformat.html:
|
Okay, no further feedback and apparently an upstream issue, so I'm repurposing this ticket. |
…sting. Those APIs are not particularly 1:1, here using NumberFormatter for NumberFormatter::format/numft_format at the moment, trying to assess what's possible for next.
…sting. Those APIs are not particularly 1:1, here using NumberFormatter for NumberFormatter::format/numft_format at the moment, trying to assess what's possible for next.
Description
The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 8.3.6
Operating System
Linux Mint 22
The text was updated successfully, but these errors were encountered: