vuejs-tips / v-money

Tiny (<2k gzipped) input/directive mask for currency
https://vuejs-tips.github.io/v-money/
776 stars 255 forks source link

Suggestion: Decimal places always needed #25

Open mzvarik opened 7 years ago

mzvarik commented 7 years ago

I want 2 decimal places.

But when I type "1", it says "0.01"

So to input "1" I have to type 3 keys!

This is really annoying...

Except that, this is the best component ever.

neves commented 7 years ago

That's true, but I couldn't find a solution for it. Do you have any idea?

mzvarik commented 7 years ago

I am new to Vue, I am pretty much lost... I am now using the Vue component here, that works, but it just adds decimals: https://jsfiddle.net/chrisvfritz/1oqjojjx/?utm_source=website&utm_medium=embed&utm_campaign=1oqjojjx

Also this one is nice, but tooo big: http://www.decorplanit.com/plugin/

MoacirSchmidt commented 7 years ago

Guy, this is the best money input for vue I have ever seen! Unfortunately, "Decimal places always needed" suggestion is a "must have" enhancement....I have no idea how to implement these vue components, but do you have access to low level javascript routines to implement that?

AndreasHerss commented 7 years ago

I Agree, this is the only thing that is keeping me from using this package :(

roncemer commented 6 years ago

Yes, there should be an option to lose the implied decimal point. Just let the user enter text free-form, then when the input loses focus, convert it to a number, round it to the correct scale, then put the rounded and formatted number back into the input and update the model's value accordingly.

phuhd-0935 commented 2 years ago

I have the same issue