开发者

Javascript convert huge float to string [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to avoid scientific notation for large numbers in javascript?

Javascript: how to avoid scientific notation when displaying large unumber

I have this code:

var f = 1000000000000000000000; // 1e+21
var fstr = f.toString(); // return "1e+21"

But I don't need scientific number representa开发者_运维百科tion. I want to get "1000000000000000000000" in 'fstr' variable. How I can get it?


You can find an util script here:

http://snippets.dzone.com/posts/show/2206

There is also a short example at the bottom of the page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜