Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > FAQ Topic - Why does parseInt('09') give an error?

Reply
Thread Tools

FAQ Topic - Why does parseInt('09') give an error?

 
 
FAQ server
Guest
Posts: n/a
 
      10-21-2006
-----------------------------------------------------------------------
FAQ Topic - Why does parseInt('09') give an error?
-----------------------------------------------------------------------

The parseInt function decides what base the number is by looking
at the number. By convention it assumes that any number beginning
with 0x is Hexadecimal, and otherwise any number beginning with
0 is Octal. To force use of base 10 add a second parameter
parseInt("09",10)

http://msdn.microsoft.com/library/en...thparseint.asp

http://docs.sun.com/source/816-6408-...ev.htm#1064173

http://www.jibbering.com/faq/faq_not....html#FAQN4_12


===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://www.jibbering.com/faq/.
The FAQ workers are a group of volunteers.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ Topic - What questions are on-topic for CLJ? (2008-10-16) FAQ server Javascript 1 10-16-2008 12:03 PM
FAQ Topic - Why does simple decimal arithmetic give strange results? FAQ server Javascript 2 08-17-2007 07:16 AM
FAQ Topic - How do I close a window and why does it not work on the first one? FAQ server Javascript 4 05-22-2007 10:29 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
FAQ Topic - Why does parseInt('09') give an error? FAQ server Javascript 24 09-20-2006 08:15 AM



Advertisments