title: Jquery Masked Input plugin allow dot
body: <p>I'm using JQuery Masked input plugin.</p>
  
  <pre><code>$("#percent").mask("99.99?9");
  </code></pre>
  
  <p>This allows numbers like <code>10.999, 10.99, 01.999, 01.99</code></p>
  
  <p>What I want to achieve is that I don't want user to type <code>01.99</code>. Instead if user types <code>1.99</code> I want <code>0</code> before <code>1</code> to be automatically added. This is how I started but don't know how to continue:</p>
  
  <pre><code>  //assume i typed in field 11.99
    $(document).on('keyup', '#percent', function(evt) {
      var input = $(this).val();
      alert(input); // 11.99_
      if(evt.which == '190' || evt.which == '110') {
         //if dot is clicked 
         alert(parseInt(input)); // 11
      }
  });
  </code></pre>
  
  <p>Note that alert input prints <code>11.99_</code> with underscore at the end since third value is optional and I didnt input it.</p>
  
  <p>Now this value is perfectly normal but if user entered <code>1.99</code>, would be unable since it would automatically move <code>9</code> towards <code>1</code> to fill it up with <code>2</code> digits, so it would return as <code>19.9</code> and this is invalid since there must be <code>2</code> decimals as defined above. So in my if statement I want to be able to detect if whatever was entered is less than <code>10</code>, if it's less than <code>10</code> in decimal points then add <code>0</code> at the beginning.</p>
  
  <p>Ok I found a fix for <code>underscore _</code> :</p>
  
  <pre><code>    $("#percent").mask("99.99?9", {placeholder: ""})
  </code></pre>
  
  <p>but still does not fix other issue with entering <code>1.99</code> being <code>19.9</code></p>