Module AutoNumeric

Index

Type aliases

BracketMode

BracketMode: "(,)" | "[,]" | "{,}" | "<,>"

The kind of brackets used for negative values when the input does not have focus.

EmptyMode

EmptyMode: "empty" | "zero" | "sign"

Whether the input is allowed to be empty or must at least contain a zero or unit sign.

GroupMode

GroupMode: 2 | 3 | 4

How to group digits, in groups of 2 (hundreds), 3 (thousands), or 4 (ten-thousands).

RoundMode

RoundMode: "S" | "A" | "s" | "a" | "B" | "U" | "D" | "C" | "F" | "CHF"

The round mode used for rounding numbers.

SignMode

SignMode: "p" | "s"

Whether the unit sign is placed before or after the number.

ValueOrSupplier

ValueOrSupplier: object

An object with properties. The value of each property is either the value directly, or a function that returns the value.

For example, it is possible to pass options to autoNumeric likes this:

$.autoNumeric({
  // Decimal separator
  aDec: ",",
  // Unit
  aSign: function() {
    return " kg";
  }
});

Type declaration

ZeroMode

ZeroMode: "allow" | "deny" | "keep"

Whether leading zeroes are allowed and how they should be treated.