-
Notifications
You must be signed in to change notification settings - Fork 1k
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
InputNumber should support global locale #4291
Comments
I think I know why. In the example NULL locale means use the browsers locale, using the global Locale its always US English So a workaround is here: https://stackblitz.com/edit/react-crtbtu?file=src%2FApp.tsx <InputNumber
inputId="locale-user"
value={value1}
onValueChange={(e: InputNumberValueChangeEvent) => setValue1(e.value)}
minFractionDigits={2}
locale={PrimeReact.locale}
/> |
so it can't be set on a global scale i suppose as another prime react components localization. Intl number localization is not part of PrimeReact locale functionality. |
Correct!!! |
I am trying to think of a clever way this could be done without breaking the default browser locale scenario... |
Submitted a PR and assigned PrimeTek to review. |
Describe the feature you would like to see added
All components should respect PrimeReact.locale
Is your feature request related to a problem?
InputNumber component already has a 'locale' attribute which works fine. However, in usual scenarios, you want to set PrimeReact.locale once and have all components respect this configuration. For example Calendar component supports the PrimeReact.locale
Ofcourse, if I set 'locale' attribute to InputNumber directly, this must be applied regardless of what is set in PrimeReact.locale
Describe the solution you'd like
When I set PrimeReact.locale, all components should use this value as a default locale
Describe alternatives you have considered
setting 'locale' attribute to InputNumber manually - works, but should not be necessary for default number formatting
Additional context
issue is at PrimeReact v8.6.1 and also latest
The text was updated successfully, but these errors were encountered: