File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Javascript cast String to Long   / parseLong() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript cast String to Long   / parseLong()" Watch "Javascript cast String to Long   / parseLong()" New topic
Author

Javascript cast String to Long / parseLong()

Adam Lim
Greenhorn

Joined: Mar 13, 2007
Posts: 5
Hello,

i wish to make 00000000001234567890 to 1234567890.

i know that javascript do not provide parseLong() function.

How can i cast String 20 digit to Long? if i use parseInt(), may hit NumberFormatException due to out of range.


please advise.

thank you.


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
JavaScript has parseFloat, but FYI Int in javascript is a float since JavaScript has only one number type.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript cast String to Long / parseLong()