title: Convert float value greater than 0.5 to 1
body: <p>I need to allow float values and convert any floating value greater than <code>0.5</code> to <code>1</code>. For example:</p>
  
  <pre><code>0.4 = 0.4
  0.5 = 0.5
  0.6 = 1
  </code></pre>
  
  <p>I have tried using Math references like below, but not suiting my requirement.</p>
  
  <pre><code>var intvalue = Math.floor( floatvalue );
  var intvalue = Math.ceil( floatvalue ); 
  var intvalue = Math.round( floatvalue );
  </code></pre>
  
  <p>Also <code>var a = parseFloat("10.5")</code> is not giving what I expected.</p>