title: Convert float to string with at least one decimal place (javascript)
body: <p>Let me give you an example.</p>
  
  <pre><code>var a = 2.0;
  var stringA = "" + a;
  </code></pre>
  
  <p>I will get: <code>stringA = "2"</code>, but I want: <code>stringA = "2.0"</code>.</p>
  
  <p>I don't want to lose precision however, so if:</p>
  
  <pre><code>var b = 2.412;
  var stringB = "" + b;
  </code></pre>
  
  <p>I want to get the standard: <code>stringB = "2.412"</code>.</p>
  
  <p>That's why <code>toFixed()</code> won't work here. Is there any other way to do it, than to explicitly check for whole numbers like this?:</p>
  
  <pre><code>if (a % 1 === 0)
      return "" + a + ".0";
  else
      return "" + a;
  </code></pre>