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?

 
 
Dr John Stockton
Guest
Posts: n/a
 
      09-14-2006
JRS: In article <(E-Mail Removed)>, dated
Thu, 14 Sep 2006 02:03:43 remote, seen in news:comp.lang.javascript,
Randy Webb <(E-Mail Removed)> posted :
>
>It should also promote the best practice and not specifying the Radix is
>a recipe for disaster for 99% of the people who would be looking that up
>in the FAQ.


Control freak. 99% != 100%.

In helping the multitude, it is wrong to mislead the intelligent
minority.

--
John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      09-15-2006
Dr John Stockton said the following on 9/14/2006 4:58 PM:
> JRS: In article <(E-Mail Removed)>, dated
> Thu, 14 Sep 2006 02:03:43 remote, seen in news:comp.lang.javascript,
> Randy Webb <(E-Mail Removed)> posted :
>> It should also promote the best practice and not specifying the Radix is
>> a recipe for disaster for 99% of the people who would be looking that up
>> in the FAQ.

>
> Control freak.


You are bordering on becoming idiotic.

> 99% != 100%.


<sarcasm>
You don't say? I am glad you let me know, otherwise the world might have
thought differently.
<sarcasm>

> In helping the multitude, it is wrong to mislead the intelligent
> minority.


The "intelligent minority" fall into the people who can master parseInt
in under 10 minutes and wouldn't be looking in the FAQ anymore. And I am
willing to wager that the 1% that I left out would include it anyway.

As I said, if you want to continue believing the garbage you are
spouting about how it could be advisable to leave it, then please live
in that fantasy world as that is all it is. I will simply repeat what I
said in the last post:

<quote>
If you want to give people the advice to try to feature detect how to
deal with Base 8, then please do. I will reply back with how ignorant
that idea is. Same for Base 10 and Base 16. There is a very simple
solution to it:

Always use the Radix and it will never matter.
</quote>

I did notice you didn't give me a potential scenario example to back up
your claim of:

<quote>
In the wider world there are applications in which it would be
appropriate to allow the user to choose between decimal and hexadecimal
directly, without auxiliary controls.
</quote>

It is trivial to give the user the option of choosing the base and to
write code to try to determine what the user wanted instead of using
"auxiliary controls" is another recipe for disaster. But, live your
fantasy John.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
 
Reply With Quote
 
 
 
 
Dr John Stockton
Guest
Posts: n/a
 
      09-15-2006
JRS: In article <(E-Mail Removed)>, dated
Fri, 15 Sep 2006 02:24:44 remote, seen in news:comp.lang.javascript,
Randy Webb <(E-Mail Removed)> posted :

> I will simply repeat what I
>said in the last post:


As you so often do : doubling the value adds nothing.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
 
Reply With Quote
 
Dr John Stockton
Guest
Posts: n/a
 
      09-19-2006
JRS: In article <44ee2f77$0$75029$(E-Mail Removed)>, dated Thu,
24 Aug 2006 23:00:01 remote, seen in news:comp.lang.javascript, FAQ
server <(E-Mail Removed)> posted :
>-----------------------------------------------------------------------
>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



While not actually matching the current FAQ topic line (change it to
"How and when should parseInt be used"), ISTM useful to add an
illustration such as
P = parseInt(b.offsetParent.offsetWidth)
where IIRC the format is decimal followed by 'px'.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      09-20-2006
Dr John Stockton said the following on 9/15/2006 5:46 PM:
> JRS: In article <(E-Mail Removed)>, dated
> Fri, 15 Sep 2006 02:24:44 remote, seen in news:comp.lang.javascript,
> Randy Webb <(E-Mail Removed)> posted :
>
>> I will simply repeat what I
>> said in the last post:

>
> As you so often do : doubling the value adds nothing.


You're an idiot. If it weren't for the misleading arguments you use to
further advance your own agenda you wouldn't be worth replying to.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
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 0 10-21-2006 11:00 PM



Advertisments