src/modules/input-mask-directives/directives/number-mask-config.intf.ts
Defines the configuration for the StarkNumberMaskDirective.
Based on the API of the createNumberMask
function from the text-mask-addons library
See https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask
Properties |
|
allowDecimal |
allowDecimal:
|
Type : boolean
|
Optional |
Whether or not to allow the user to enter a fraction with the amount. Default: |
allowLeadingZeroes |
allowLeadingZeroes:
|
Type : boolean
|
Optional |
Whether or not to allow leading zeroes. Default: |
allowNegative |
allowNegative:
|
Type : boolean
|
Optional |
Whether or not to allow negative numbers. Default: |
decimalLimit |
decimalLimit:
|
Type : number
|
Optional |
Number of digits to allow in the decimal part of the number. Default: |
decimalSymbol |
decimalSymbol:
|
Type : string
|
Optional |
Character to be used as decimal point. Default: |
includeThousandsSeparator |
includeThousandsSeparator:
|
Type : boolean
|
Optional |
Whether or not to separate thousands. Default: |
integerLimit |
integerLimit:
|
Type : number
|
Optional |
Limit the length of the integer number. Default: |
prefix |
prefix:
|
Type : string
|
Optional |
String to be displayed before the amount. Default: |
requireDecimal |
requireDecimal:
|
Type : boolean
|
Optional |
Whether or not to always include a decimal point and placeholder for decimal digits after the integer. Default: |
suffix |
suffix:
|
Type : string
|
Optional |
String to be displayed after the amount. Default: |
thousandsSeparatorSymbol |
thousandsSeparatorSymbol:
|
Type : string
|
Optional |
Character to be used as thousands separator. Default: |
export interface StarkNumberMaskConfig {
/**
* String to be displayed before the amount.
*
* Default: `""` (empty string)
*/
prefix?: string;
/**
* String to be displayed after the amount.
*
* Default: `""` (empty string)
*/
suffix?: string;
/**
* Whether or not to separate thousands.
*
* Default: `true`
*/
includeThousandsSeparator?: boolean;
/**
* Character to be used as thousands separator.
*
* Default: `","`
*/
thousandsSeparatorSymbol?: string;
/**
* Whether or not to allow the user to enter a fraction with the amount.
*
* Default: `false`
*/
allowDecimal?: boolean;
/**
* Character to be used as decimal point.
*
* Default: `"."`
*/
decimalSymbol?: string;
/**
* Number of digits to allow in the decimal part of the number.
*
* Default: `2`
*/
decimalLimit?: number;
/**
* Limit the length of the integer number.
*
* Default: `undefined` (unlimited)
*/
integerLimit?: number;
/**
* Whether or not to always include a decimal point and placeholder for decimal digits after the integer.
*
* Default: `false`
*/
requireDecimal?: boolean;
/**
* Whether or not to allow negative numbers.
*
* Default: `true`
*/
allowNegative?: boolean;
/**
* Whether or not to allow leading zeroes.
*
* Default: `false`
*/
allowLeadingZeroes?: boolean;
}