jonathanpmartins / v-money3

Vue3 currency input/directive mask
MIT License
103 stars 27 forks source link

Display not same with the actual value in model #76

Open ikhbalfuady opened 1 year ago

ikhbalfuady commented 1 year ago

i have been longtime using this library, but its my first time getting some bugs, and make me take a long time to refactory my code, but still stuck, the bug will be affected when iam typing value : 0.10 in model, value is right, return 0.1, but in display, showing value 0.01, so i've got confused with that result the result will be same when i fill the rounded value after decimal separator, like : 0.20, 0.30, 0.90 , the model returned right value, but in display its not same.

this my config

const config = {
      decimal: ',',
      thousands: '.',
      prefix: '',
      suffix: '',
      precision: 2,
      max: 999999999999,
      // masked: false,
      modelModifiers: {
        number: true,
      }
    }
yanbrasiliano commented 1 year ago

I am having the same problem. When I send the value through a form, the value sent is wrong. Exemple:

image

this is my config:

config: {
        prefix: 'R$ ',
        thousands: '.',
        decimal: ',',
        precision: 2,
        disableNegative: true,
        min: 0,
      },
yanbrasiliano commented 1 year ago

modelModifiers: { number: true, }

I solved this problem using v-model.lazy in my main model.

ikhbalfuady commented 1 year ago

my problem has solved when iam using Money3Component, before i used the directive, but i have limitation with component, but for now , my target the problem must be solved first haha maybe in the next vue 4 it will be fixed

jonathanpmartins commented 1 year ago

What are your limitations with component?