0.1.11 • Published 2 years ago

vue-amount-format-input v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue-amount-format-input

Inspired by AutoNumeric, after using it for many years, decided to create my own amount format input for Vue3. Made this focused on my needs for my personal projects, but feel free to open issues for new behaviours or problems you found, I'll try my best to help you.

To Install

npm install --save vue-amount-format-input

Once you have installed the package, in your entry file of the repository (main.js) if you are using it in a Vue CLI project. Write the import command

import AmountFormatInputInstall from 'vue-amount-format-input'

app.use(AmountFormatInputInstall)

Options this input supports and it's default values:

Options allow you to customize how the input will format the amount as you type.

OptionDescriptionDefault Value
digitGroupSeparatorThousands group separatornull
decimalCharDecimal separator character. Allowed values: . , ٫.
showCurrencyOnFocusDefines if currency should be shown on input focusfalse
showCurrencyOnHoverDefines if currency should be shown on input hoverfalse
currencySymbolDefines currency symbol to displaynull
currencySymbolPlacementDefines where currencySymbol will be displayed. Possible values p for prefix and s for suffixp
maxValueThe maximum value that can be entered99999999999999.98

Our Input will receive these options as an Object in prop options as the example below:

options = {
	digitGroupSeparator: '',
	decimalChar: '.',
	showCurrencyOnFocus: false,
	showCurrencyOnHover: false,
	currencySymbolPlacement: 'p',
	currencySymbol: '',
	maxValue: 99999999999999.98
}

TODO List

Options to be added to input:

  • emptyInputBehavior
  • decimalsAllowed
0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago