title: Get decimal portion of a number with JavaScript
body: <p>I have float numbers like <code>3.2</code> and <code>1.6</code>.</p>
  <p>I need to separate the number into the integer and decimal part. For example, a value of <code>3.2</code> would be split into two numbers, i.e. <code>3</code> and <code>0.2</code></p>
  <p>Getting the integer portion is easy:</p>
  <pre><code>n = Math.floor(n);
  </code></pre>
  <p>But I am having trouble getting the decimal portion.
  I have tried this:</p>
  <pre><code>remainder = n % 2; //obtem a parte decimal do rating
  </code></pre>
  <p>But it does not always work correctly.</p>
  <p>The previous code has the following output:</p>
  <pre><code>n = 3.1 // gives remainder = 1.1
  </code></pre>
  <p>What I am missing here?</p>