-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[i18n] Format numbers according to locale #24495
Comments
@benknight Thanks for opening this issue. You can find the same issue in Ant Design under ant-design/ant-design#19337. So far, we offer the same solution, meaning developers can customize the In the data grid, we have partially solved the problem with the solution you are proposing: valueFormatter: ({ value }) => (value && isNumber(value) && value.toLocaleString()) || value, However, this solution is not compatible with server-side rendering nor used everywhere:
https://mui.com/x/react-data-grid/pagination/ At this point, I think that we could explore these solutions:
|
Of course, I neglected to consider that localization is a much larger, nuanced issue when considering SSR. Thanks for enlightening me towards the complexities involved. |
#40589 covers a sub-problem on this, on how to format numbers for the table pagination page size picker in Persian/Arabic. |
Very large numbers are left unformatted in TablePagination, for example:
Probably it should get formatted via
Number.prototype.toLocaleString()
Benchmarks
The text was updated successfully, but these errors were encountered: