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
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 15362
    
    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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Javascript cast String to Long / parseLong()
 
Similar Threads
parseLong(String s, int radix) - What is a radix ?
Cast a String to a long?
Performance difference between Long.longValue() and Long.parseLong()
a wrapper class question
parseLong(String s, int radix) ...What is a radix ?