formcycle 8.3.6 - JavaScript for forms
    Preparing search index...

    Interface InitOptions

    Options that may be passed to autoNumeric during initialization. You can initialize autoNumeric by selecting an input element and calling the autoNumeric function. You can pass an options object to that function call:

    $("[data-name='tfMoney']").autoNumeric(options);
    

    The available options are documented below.

    Please note that instead of specifying the options via JavaScript, you can also add HTML data attributes to the input field:

    <input id="money-field"
    data-a-dec=","
    data-a-sign="kg"
    data-v-min="1"
    data-v-max="100"
    data-m-dec="3"
    >
    interface InitOptions {
        aDec: string;
        aForm: boolean;
        altDec: string;
        aPad: boolean;
        aSep: string;
        aSign: string;
        dGroup: GroupMode;
        lZero: ZeroMode;
        mDec: number;
        mRound: RoundMode;
        nBracket: BracketMode;
        pSign: SignMode;
        vMax: number;
        vMin: number;
        wEmpty: EmptyMode;
    }
    Index

    Properties

    aDec: string

    Controls the decimal character. Default is a period (.).

    aForm: boolean

    Controls if default (initial) values are formatted on page ready (load).

    • true: Initial values are formatted on page ready (this is the default behavior)
    • false: Initial values are not formatted on page ready. Formatting starts once the user starts typing.
    altDec: string

    This was developed to accommodate for different keyboard layouts. altDec allows you to declare an alternative key to enter the decimal separator assigned in aDec

    aPad: boolean

    Controls padding of the decimal places. true: always pads the decimal with zeros (default) false: no padding

    aSep: string

    Controls the thousand separator character. Default is comma (,).

    aSign: string

    Displays the desired currency or unit symbol (examples: or EUR). Default is undefined.

    If not set, no unit symbol is shown.

    dGroup: GroupMode

    Controls the digital grouping and the placement of the thousand separator, e.g.

    • 2: Groups of hundreds, e.g. 13,24,98
    • 3: Groups of thousands, e.g. 132,498 (default)
    • 4: Groups of ten-thousands, e.g. 13,2498
    lZero: ZeroMode

    Controls leading zeros behavior.

    • allow: Allows leading zero to be entered. They are removed on focusout event (default).
    • deny: Leading zeros not allowed.
    • keep: Leading zeros allowed and will be retained on the focusout event.
    mDec: number

    Overrides the decimal places that are set via the vMin / vMax settings. Default is undefined.

    mRound: RoundMode

    Sets the rounding method used. Available methods are:

    • S: Round-Half-Up Symmetric (default)
    • A: Round-Half-Up Asymmetric
    • s: Round-Half-Down Symmetric
    • a: Round-Half-Down Asymmetric
    • B: Round-Half-Even "Bankers Rounding"
    • U: Round Up "Round-Away-From-Zero"
    • D: Round Down "Round-Toward-Zero" - same as truncate
    • C: Round to Ceiling "Toward Positive Infinity"
    • F: Round to Floor "Toward Negative Infinity"
    • CHF: Rounding for Swiss currency "to the nearest .00 or .05"
    nBracket: BracketMode

    Controls if negative values are displayed with brackets when the input does not have focus. Default is undefined.

    pSign: SignMode

    Controls the placement of the currency or unit symbol (prefix or suffix).

    • p: prefix to the left (default).
    • s: suffix to the right.
    vMax: number

    Controls the maximum allowed value. Default is 9999999999999.99.

    vMin: number

    Controls the minimum allowed value. Default is -9999999999999.99.

    wEmpty: EmptyMode

    Controls input display behavior.

    • empty: Allows input to be empty (default)
    • zero: Input field will have at least a zero value.
    • sign: The currency symbol is always present.