cdn

AutoNumeric

Released Installed

Automatically format numbers and currencies as the user types.

How to include

<script src="https://cdn.roste.org/autonumeric/latest/autoNumeric.min.js"></script>

Download zip


Currency input

Type a number — AutoNumeric formats it as USD.

Formatted value updates as you type…

<script src="latest/autoNumeric.min.js"></script>
<input id="amount" type="text" value="1234.56" />
<script>
  const an = new AutoNumeric("#amount", { currencySymbol: "$", decimalPlaces: 2 });
  console.log(an.getNumber());
</script>