Jump to content

Convert a number to a string avoding the exponential notation


graduate

Recommended Posts

If a big number is converted to a string of decimal figures, it's converted in the exponential notation (1.22e30), but when the radix is not 10, it is converted alright. How to write a big number with all figures? var n = 1.456e22;console.log(n.toString()); // 1.456e+22 // I want to get 14560000000000000000000console.log(n.toString(9)); // 157053416456027132045467 // all figures for any other radix except 10

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...