Skip to content

[intl] Expose the ICU NumberRangeFormatter #18599

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

Open
stof opened this issue May 19, 2025 · 3 comments
Open

[intl] Expose the ICU NumberRangeFormatter #18599

stof opened this issue May 19, 2025 · 3 comments

Comments

@stof
Copy link
Contributor

stof commented May 19, 2025

Description

ICU4C has a NumberRangeFormatter API allowing to format a range between 2 numbers based on the convention of each locale.

It would be great to provide a PHP API based on it.

@stof
Copy link
Contributor Author

stof commented May 19, 2025

This was first mentioned by @Ayesh in #18346 (comment)

@BogdanUngureanu
Copy link
Contributor

BogdanUngureanu commented May 19, 2025

According to the docs, that class (and its C equivalent) are stable since ICU 63 68. Unfortunately, PHP should support ICU 57.1 and up. The version was bumped recently I believe.

I implemented IntlListFormatter because the base functionality (without OR and UNITS) was supported in 57.

@nielsdos
Copy link
Member

It's still possible to support it, with conditional compilation. It's not unheard of making some classes / functions only available for recent lib versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants