4👍
You could use the format method of JS like this:
const amount = 10000;
const options2 = { style: 'currency', currency: 'USD' };
const numberFormat2 = new Intl.NumberFormat('en-US', options2);
console.log(numberFormat2.format(amount));
// expected output: "$10,000"
Here my guide to update, you only declare 2 variable in global
const options2 = { style: 'currency', currency: 'USD', minimumFractionDigits: 0 };
const numberFormat2 = new Intl.NumberFormat('en-US', options2);
And replace `return ‘$’ + value by this:
return numberFormat2.format(value.toFixed(0).replace(/\.0+$/, ""));
- Chartjs-Chart.js not working in browser with django. no error for template and static folder setting
Source:stackexchange.com