How do you format the numbers that result in total of 12 digits?
12.123 should result 12.1230000000
1234567890.12345 should result 1234567890.12
12 should result 12.0000000000
How do you format the numbers that result in total of 12 digits?
12.123 should result 12.1230000000
1234567890.12345 should result 1234567890.12
12 should result 12.0000000000
Number.prototype.toPrecision()
function FormatMeTo12Digits(num) {
return num.toPrecision(12);
}
FormatMeTo12Digits(12.345);