Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove decimal separator #233

Open
kamanlid opened this issue Sep 28, 2020 · 2 comments
Open

Remove decimal separator #233

kamanlid opened this issue Sep 28, 2020 · 2 comments

Comments

@kamanlid
Copy link

Great work! thanks for sharing.

Is there a way to remove the decimal separator (thousands separator) from the values displayed?
The Gauge displays numbers above 1000 with separator even if the input value doesn't have it.

Thanks!

@SemaphoreOxalis
Copy link

Hi, we have the same question here because we don't use this separator in french ;-)

@austenstone
Copy link

Function would need to change.

The commas are added here.

gauge.js/dist/gauge.js

Lines 96 to 110 in 9ec4aca

addCommas = function(nStr) {
var rgx, x, x1, x2;
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = '';
if (x.length > 1) {
x2 = '.' + x[1];
}
rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
};

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

No branches or pull requests

3 participants