Closed mazraara closed 3 years ago
i am using this as a directive, when i am using the component then this issue is no longer present
I will take a look at it next week. I'm currently refactoring some of the original code and this issue is next on the list! Thanks for reporting!
The code-base has suffered a big refactoring. Some behavior has become default with v-model
. Please read the news on the docs page.
Directives are capable to work with Arbitrary Precision
but in exchange it cannot work with floats by default anymore. Directives use v-model
...
Using v-model
with precision 2
:
1
it will interpret it as 0.01
.10
or 1.0
it will interpret it as 0.10
.100
or 10.0
it will interpret it as 1.00
.1.00
it will interpret it as 1.00
.10.00
it will interpret it as 10.00
.100.00
it will interpret it as 100.00
.The components allow you to work with numbers with the v-model.number
modifier.
Using v-model.number
with precision 2
:
1
it will interpret it as 1.00
.10
or 1.0
it will interpret it as 10.00
.100
or 10.0
it will interpret it as 100.00
.1.0
it will interpret it as 1.00
.10.0
it will interpret it as 10.00
.100.0
it will interpret it as 100.00
.I really encourage you to use the component instead of the directive, or change your format value when setup.
But...
If you really want to work with directives you can configure it manually.
This sould work on the new release of v-money3
.
<input :model-modifiers="{ number: true }" v-model.lazy="amount" v-money3="config" />
when allowBlank is FALSE
€30.00 10.00%
allowBlank is TRUE
€0.30 0.10%
below is my overall config
{ "decimal": ".", "thousands": ",", "prefix": "€", "suffix": "", "min": 0, "max": 1000000, "precision": 2, "masked": false, "allowBlank": true, "disableNegative": true }