Re: FAQ Topic - Why does parseInt('09') give an error?
- From: Dr John Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 1 Sep 2006 21:06:17 +0100
JRS: In article <_O-dnTujw4yz62XZnZ2dnUVZ_vadnZ2d@xxxxxxxxxxx>, dated
Fri, 1 Sep 2006 14:05:30 remote, seen in news:comp.lang.javascript,
Randy Webb <HikksNotAtHome@xxxxxxx> posted :
<FAQENTRY>
"If no Base is given, the parseInt function decides what base the number
is in by looking at the number. It assumes that any number beginning
with 0x is Hexadecimal, and may assume that any number beginning with 0
is Octal. To remove this ambiguity, always use the Radix parameter with
parseInt".
</FAQENTRY>
Naive. There are circumstances in which it is right for the user to
choose the base from 8, 10, 16. Don't be a Stalinist.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
.
- Follow-Ups:
- Re: FAQ Topic - Why does parseInt('09') give an error?
- From: Randy Webb
- Re: FAQ Topic - Why does parseInt('09') give an error?
- References:
- Re: FAQ Topic - Why does parseInt('09') give an error?
- From: Randy Webb
- Re: FAQ Topic - Why does parseInt('09') give an error?
- Prev by Date: Escaping/encoding in an href with javascript
- Next by Date: Re: Line Graph Implementation in various browsers
- Previous by thread: Re: FAQ Topic - Why does parseInt('09') give an error?
- Next by thread: Re: FAQ Topic - Why does parseInt('09') give an error?
- Index(es):
Relevant Pages
|
Loading