plentz / jquery-maskmoney

jQuery plugin to mask data entry in the input text in the form of money (currency).

Home Page:https://plentz.github.io/jquery-maskmoney/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set default value 0,00 with negative prefix

alexalannunes opened this issue · comments

I'd like to start maskMoney with negative values. Start with negative prefix -

<input
   type="text"
   ng-model="ds.desconto[idx_goal].desconte"
   class="form-control currency"
   placeholder="Pague R$"
   min="0"
   data-thousands="."
   data-decimal=","
   data-prefix="R$ "
   data-allow-negative="true" />

My solution

$0.onclick = function() {
  this.value = '-' + this.value
}

It works!

I'd like other way