Skip to content
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

Locale extensions are not supported in fmt:formatNumber #266

Open
jaksah opened this issue Sep 20, 2024 · 0 comments
Open

Locale extensions are not supported in fmt:formatNumber #266

jaksah opened this issue Sep 20, 2024 · 0 comments

Comments

@jaksah
Copy link

jaksah commented Sep 20, 2024

While upgrading from Java 8 to Java 21 I noticed the default formatting of US currency changed from displaying negative numbers within parenthesis to displaying the minus sign, i.e. value -123 displayed as ($123) in Java 8 and -$123 in Java 21. This behavior was probably introduced in an earlier JDK version

According to OpenJDK's NumberFormatProviderImpl, this behavior could be accomplished again by using a Locale with an extension e.g. en-US-u-cf-account. However, using
<fmt:setLocale value="en-US-u-cf-account"/> has no effect on <fmt:formatNumber>

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

No branches or pull requests

1 participant