-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add support for ordinals in NumberFormat
#484
Comments
Currently, there is no support for ordinal plural rules in this package, which differ from the cardinal plural rules as described here. This would certainly be a nice addition, but would also increase code size. Building a formatter on top of that would be then be easy, see the JS documentation. If we would actually want a separate formatter for this, again having to add the cases for different locales, increasing code size, would have to be discussed. |
Prior art exists in other languages, c.f. Swift: https://developer.apple.com/documentation/foundation/numberformatter/style/ordinal |
For now, we have the option of using |
Agreed! Thanks for mentioning an alternative. |
For the new I agree that this seems like a good feature to have in an i18n library. |
Is your feature request related to a problem? Please describe.
I want to format a number with an ordinal suffix (e.g. "1st", "2nd", "3rd", "205th") in a localized way, as different languages have different ordinal suffixes.
Describe the solution you'd like
I would like a
NumberFormat
that formats a number with an ordinal suffix, e.g., similar to
NumberFormat.compact
.Describe alternatives you've considered
I'm currently using a custom solution, however this obviously only works in English and is not localized.
I've also considered using native libraries (as all platforms supported by Flutter have native support for this), but this would mean that:
Additional context
This issue is not a duplicate of #163, as this functionality does not inherently involve formatting dates, it's purely related to formatting numbers, and should therefore likely be an addition to
NumberFormat
.The text was updated successfully, but these errors were encountered: