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

Thousands comma separator not showing #894

Open
atoohill opened this issue Nov 30, 2022 · 2 comments · May be fixed by #895
Open

Thousands comma separator not showing #894

atoohill opened this issue Nov 30, 2022 · 2 comments · May be fixed by #895

Comments

@atoohill
Copy link

When I define data-type="number" the comma is removed from the thousands separator in the output.

Trying to figure out how to have the comma included.

@otovalek otovalek linked a pull request Mar 25, 2023 that will close this issue
@otovalek
Copy link

There is is bug at

if (s.length == 2 && s[0].length > 3) {

#895 fixes it.

A workaround is to define a custom formatter for the column:

"formatter": function(value, options, rowData) {
                 if (value == null) return '';
                 var s = (value + '').split('.');
                 s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, this.thousandSeparator);
                 return s.join(this.decimalSeparator);
             }

@atoohill
Copy link
Author

@otovalek - we need some assistance to implement this workaround. How can I discuss with you privately?

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

Successfully merging a pull request may close this issue.

2 participants