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

Discussion in 'Javascript' started by FAQ server, Oct 22, 2006.

  1. FAQ server

    FAQ server Guest

    -----------------------------------------------------------------------
    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-us/script56/html/js56jsmthparseint.asp

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

    http://www.jibbering.com/faq/faq_notes/faq_notes.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.
     
    FAQ server, Oct 22, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,995
    Smokey Grindel
    Dec 2, 2006
  2. Paul Melis

    Why oh why does this NOT give a compile error?

    Paul Melis, Nov 5, 2007, in forum: C Programming
    Replies:
    13
    Views:
    521
    cr88192
    Nov 7, 2007
  3. FAQ server
    Replies:
    24
    Views:
    313
    Randy Webb
    Sep 20, 2006
  4. FAQ server
    Replies:
    14
    Views:
    175
    Randy Webb
    Dec 29, 2006
  5. FAQ server
    Replies:
    2
    Views:
    136
    John Hosking
    Aug 17, 2007
Loading...

Share This Page