title: How do you format money but allow negative numbers
body: <p>I have this awesome function to format money as users enter it, however I can't seem to figure out how to accept negative values.</p>
  
  <pre><code>$(this).on('change click keyup input paste', 'input.dollar', function() {
      $(this).val(function(index, value) {
          return value.replace(/(?!\.)\D/g, "").replace(/(?:\..*)\./g, "").replace(/\.(\d\d)\d?$/, '.$1').replace(/\B(?=(\d{3})+(?!\d))/g, ",");
      });
  });
  </code></pre>