Is there a way to get number.toLocaleString() with 4 digits after the comma?
number.toLocaleString()
Example:
var number = 49.9712; document.getElementById(\'id
You cannot do this with toLocaleString() alone. But you can round to 4 decimal places before displaying:
toLocaleString()
var n = Math.round(number * 10000) / 10000; document.getElementById('id').innerText = n.toLocaleString();