By default the decimal value is disabled. To use decimals in the value, add the precision prop.
precision accept a String or Number numeric value.
<vue-numeric v-bind:precision="2"></vue-numeric>
Thousands separator
Default thousand separator's symbol is ,.
Use the separator prop to change the thousands separator.
separator only accepts space, , or ..
When using the . or space as thousand separator, the decimal separator will be ,.
<vue-numeric separator="."></vue-numeric>
Input placeholder when empty
<vue-numeric placeholder="only number allowed"></vue-numeric>
Value when empty
By default, when you clean the input the value is set to 0. You can change this value to fit your needs.
<vue-numeric :empty-value="1"></vue-numeric>
Output Type
By default the value emitted for the input event is of type Number. However you may choose to get a String instead
by setting the property output-type to String.
<vue-numeric output-type="String"></vue-numeric>
Props
Props
Description
Required
Type
Default
currency
Currency prefix
false
String
-
currency-symbol-position
Position of the symbol (accepted values: prefix or suffix)
false
String
prefix
max
Maximum value allowed
false
Number
9007199254740991
min
Minimum value allowed
false
Number
-9007199254740991
minus
Enable/disable negative values
false
Boolean
false
placeholder
Input placeholder
false
String
-
empty-value
Value when input is empty
false
Number
0
output-type
Output Type for input event
false
String
String
precision
Number of decimals
false
Number
-
separator
Thousand separator symbol (accepts space, . or ,)
false
String
,
decimal-separator
Custom decimal separator
false
String
-
thousand-separator
Custom thousand separator
false
String
-
read-only
Hide input field and show the value as text
false
Boolean
false
read-only-class
Class for read-only element
false
String
''
License
Vue-Numeric is open-sourced software licensed under the MIT license
Support
Hello, I'm Kevin the maintainer of this project in my free time (which is getting lessen these days), if this project does help you in any way please consider to support me. Thanks :smiley: