Answers for "js number format library"

3

js number format

function numberWithSpaces(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
Posted by: Guest on October-08-2021
0

javascript number format

var x = parseFloat('9.656');

x.toFixed(0);           // returns 10
x.toFixed(2);           // returns 9.66
x.toFixed(4);           // returns 9.6560
x.toFixed(6);
Posted by: Guest on June-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language