[removed] how to avoid scientific notation when displaying large unumber

后端 未结 2 1420
感动是毒
感动是毒 2021-01-20 08:27

Based on http://users.dickinson.edu/~braught/courses/cs131s99/Lessons/03-Out&Data.html, for readability, JavaScript uses scientific notation to display very large number

2条回答
  •  失恋的感觉
    2021-01-20 08:53

    You can use something like YourJS.fullNumber(). For instance you could try something like YourJS.fullNumber(1e20) to produce 100000000000000000000. Try out your own code here:

    https://www.yourjs.com/console/?gist=9dce161c033e7391b2f871a19006a653&file=Example+of+YourJS.fullNumber.js

提交回复
热议问题