🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Weight Mask is a lightweight and easy to use jQuery input mask plugin that automatically formats currency and any other numeric values as you type on form inputs.

number-format input-mask

Documentation

jQuery Weight Mask Plugin

Full documentation with showcases

Full documentation available on http://www.smartsource.pl/weight-mask

Compatible with:

  • iOS
  • Android
  • Chrome
  • Firefox
  • Safari
  • Internet Explorer

Example kilos mask with max 3 integers:

<input type="text" class="form-control" id="masked-1">  $('#masked-1').maskWeight({  integerDigits: 3,  decimalDigits: 3,  decimalMark: ',',  //initVal default: generated  //roundingZeros default: true }); 

Options

Plugin offers few options to customize mask:

{  integerDigits: 3,  decimalDigits: 3,  decimalMark: '.',  initVal: '000,000',  roundingZeros: true } 

integerDigits default 3. Describes number of integers before decimal mark

decimalDigits default 3. Describes number of decimal places after decimal mark. Can be 0, then mask works only with integers!

decimalMark default '.' (dot). Sets custom decimal mark

initVal Sets custom initial value. Default generated based on **integerDigits ** and decimalMark and decimalDigits and roundingZeros. For example if we set those options we get 0,000:

{  integerDigits: 2,  decimalDigits: 3,  decimalMark: ',',  roundingZeros: true } 

For those options we get 000,00:

{  integerDigits: 3,  decimalDigits: 2,  decimalMark: ',',  roundingZeros: false } 

roundingZeros default true. Determine if zeros in integer digits (before decimal mark) should be rounded. For example if real typed value will be 001,555 then after rounding input value will be 1,555. If setted to false zeros wil be shown in input.

License & Author

Copyright (c) 2016 Dawid Senko, Licensed under the MIT license (http://opensource.org/licenses/mit-license.php)


You May Also Like