I need to display a number in HTML with spaces between its millions, is there any easy formatting that allows to do so?
I want to display 999 999 999, instead of 999999999
As I stated in my comment. You will not be able to format the number in the way you want using HTML. You will have to use JavaScript.
Here is how you would do it using plain JavaScript.
For reference:
function formatNumber(n) {
if (n < 0) { throw 'must be non-negative: ' + n; }
if (n === 0) { return '0'; }
var output = [];
for (; n >= 1000; n = Math.floor(n/1000)) {
output.unshift(String(n % 1000).padStart(3, '0'));
}
output.unshift(n);
return output.join(' ');
}