Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try <a href="https://developer.mozilla.org/en/Javascript/Reference/Global_Objects/parseInt" rel="noreferrer">parseInt</a>.</p> <pre><code>parseInt("065", 10); </code></pre> <p><hr/> The second parameter is for the <a href="http://en.wikipedia.org/wiki/Radix" rel="noreferrer">radix</a> and as per the documentation it should always be specified. MDN says,</p> <blockquote> <p><strong>radix</strong> </p> <p>An integer that represents the radix of the above mentioned string. Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified.<br> .............<br> .............<br> If radix is undefined or 0 (or absent), JavaScript assumes the following:</p> <ul> <li>If the input <em>string</em> begins with "0x" or "0X", radix is 16 (hexadecimal) and the remainder of the string is parsed. </li> <li>If the input <em>string</em> begins with "0", radix is eight (octal) or 10 (decimal). Exactly which radix is chosen is implementation-dependent. ECMAScript 5 specifies that 10 (decimal) is used, but not all browsers support this yet. For this reason <strong>always specify a radix when using parseInt</strong>. </li> <li>If the input <em>string</em> begins with any other value, the radix is 10 (decimal).</li> </ul> </blockquote> <p>For example, in some implementations <code>parseInt("01803")</code> will yield <code>1</code>. Assuming the goal is to get <code>1803</code>, call parseInt with a radix of 10 to ensure the parsing is done in a base decimal numbering system. That is: <code>parseInt("01803", 10)</code> will yield <code>1803</code>. Please note that for a non-integer value, parseInt() will round the number to return as an integer. <code>paseInt("018.03", 10)</code> will yield <code>18</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload