title: get number value from input element in JQuery not works when float parts empty
body: <p>I want to code a currency converter, and only integer and float are allowed.So i detect the input change and do some calculation. 
  html snippet is as below:</p>
  
  <pre><code>&lt;input type="number" id="currency"&gt;
  </code></pre>
  
  <p>JS is:</p>
  
  <pre><code>$("#currency").on("input", function(e){
    var value = this.value
    console.log(value)
  });
  </code></pre>
  
  <p>Everything works well except when input is "12.", the value is an empty string?
  what i want is 12 actually. How to solve the issue? Any help would be appreciated.
  <a href="https://jsfiddle.net/5snrsryy/6/" rel="nofollow">JSfiddle of snippet</a></p>