开发者

How do I parse the following string? [duplicate]

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

Possible Duplicates:

How to parseInt a string with leading 0

Workarounds for JavaScript parseInt oc开发者_如何转开发tal bug

How can I parse the "09" into number?

alert(parseInt("09"));

This returns me 0 ..Why is that and how do I fix this?


Specify the base as well:

alert(parseInt("09", 10));  // outputs 9
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜