title: Convert a decimal number to a fraction / rational number
body: <p>In JavaScript, is there any way to convert a decimal number (such as <code>0.0002</code>) to a fraction represented as a string (such as "<code>2/10000"</code>)?</p>
  
  <p>If a function called <code>decimalToFraction</code> had been written for this purpose, then <code>decimalToFraction(0.0002)</code> would return the string <code>"2/10000"</code>.</p>