I'm trying to format values as money in one project, and those values can be negative.
I'm stuck in how to create the correct mask. I did one jsfiddle:
<input type="text" class="negative-money" />
$(document).ready(function() {
var mask = $('.negative-money');
var money = -1011987.65;
mask.val(money);
mask.mask('-{000,}000.00');
// ---------^^^^^^ the problem is here
});
I looked some examples and read some articles, but I couldn't figure out how to do it.
I want the output for the previous example to be: -1,011,987.65