vuejs-tips / v-money

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

v-money directive not displaying decimals properly #70

Open npulukuri opened 6 years ago

npulukuri commented 6 years ago

Hi, I am using v-money directive. I kept the precision as 2. When the value is 16000, It is displaying as 160.00. It is working fine for the values that has already decimals. For example 15200.48 is fine. If I key precision as 0, 16000 is displayed properly but 15200.48 is displayed as 1520048. Is there any way to take care of the value that do not have decimal values. I want the output for 16000 as 16000.00

Thanks, Narsi

WesleyF commented 6 years ago

I have the same issue with binding...

tfolk commented 6 years ago

Same issue. Here's a JSFiddle demonstrating the issue: https://jsfiddle.net/nj3cLoum/1892/

gustavoborges25 commented 5 years ago

Change the value to string (with dot). "16000.00". In your database use the column as decimal(16,2), not double