API
Functions
declare const useCurrencyInput: (options: CurrencyInputOptions, autoEmit?: boolean) => UseCurrencyInput
parse
declare const parse: (formattedValue: string | null, options: CurrencyFormatOptions) => number | null
Enums
CurrencyDisplay
enum CurrencyDisplay {
symbol = 'symbol',
narrowSymbol = 'narrowSymbol',
code = 'code',
name = 'name',
hidden = 'hidden'
}
ValueScaling
enum ValueScaling {
precision = 'precision',
thousands = 'thousands',
millions = 'millions',
billions = 'billions'
}
Interfaces
NumberRange
interface NumberRange {
min?: number
max?: number
}
interface CurrencyFormatOptions {
locale?: string
currency: string
currencyDisplay?: CurrencyDisplay
precision?: NumberRange | number
accountingSign?: boolean
}
interface CurrencyInputOptions extends CurrencyFormatOptions {
exportValueAsInteger?: boolean
hideCurrencySymbolOnFocus?: boolean
hideGroupingSeparatorOnFocus?: boolean
hideNegligibleDecimalDigitsOnFocus?: boolean
autoDecimalDigits?: boolean
autoSign?: boolean
valueRange?: NumberRange
useGrouping?: boolean
valueScaling?: ValueScaling
}
interface UseCurrencyInput {
inputRef: Ref
numberValue: Ref<number | null>
formattedValue: Ref<string | null>
setValue: (number: number | null) => void
setOptions: (options: CurrencyInputOptions) => void
}