Learn about visual thememore

Autonumeric

The autonumeric directive automatically formats currency and other numbers that users enter in form inputs. This directive wraps the third-party autoNumeric library. For in-depth information about autoNumeric and its capabilities, see the autoNumeric documentation.

Link for section titled Installation
Installation

NPM package
@skyux/autonumericView in NPM | View in GitHub None found.
Install with NPM
npm install --save-exact @skyux/autonumeric None found.

Link for section titled SkyAutonumericModule
SkyAutonumericModule

Type: Module

import { SkyAutonumericModule } from '@skyux/autonumeric';

Link for section titled SkyAutonumericDirective
SkyAutonumericDirective

Type: Directive

Selector: input[skyAutonumeric]

Wraps the autoNumeric utility to format any type of number, including currency.

Inputs

skyAutonumeric: SkyAutonumericOptions | undefined

Assigns the name of a property from SkyAutonumericOptionsProvider.

Link for section titled SkyAutonumericOptions
SkyAutonumericOptions

Type: Type alias

Custom options to provide to the underlying AutoNumeric library. The value can be set to string, which is an alias that represents a set of predefined set of options for a currency or language, or Options, which is a custom set of options that override any default options that the skyAutonumeric attribute specifies.

type SkyAutonumericOptions = string | keyof AutoNumeric.PredefinedOptions | AutoNumeric.Options

Link for section titled SkyAutonumericOptionsProvider
SkyAutonumericOptionsProvider

Type: Service

Provides options to the underlying AutoNumeric library. This can set global options on multiple input fields.

Methods

The value for a settings object to pass to the AutoNumeric library. This overrides any default options specified by the skyAutonumeric attribute.

Returns

SkyAutonumericOptions