e.g.Number.MAX_VALUE.toString()
is "1.7976931348623157e+308"
I hope there is no e+308
,How to achieve this ?
e.g.Number.MAX_VALUE.toString()
is "1.7976931348623157e+308"
I hope there is no e+308
,How to achieve this ?
You could do like this:
var n = Number.MAX_VALUE.toString();
var parts = n.split("e+");
var first = parts[0].replace('.', "");
var zeroes = parseInt(parts[1], 10) - (first.length - 1);
for(var i = 0; i < zeroes; i++){ first += "0"; }
// => first === "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"