Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casas decimais sendo interpretadas de maneira incorreta #91

Open
JhonatanPereira opened this issue Feb 20, 2024 · 1 comment
Open

Casas decimais sendo interpretadas de maneira incorreta #91

JhonatanPereira opened this issue Feb 20, 2024 · 1 comment

Comments

@JhonatanPereira
Copy link

JhonatanPereira commented Feb 20, 2024

v-money3/src/format.js

Lines 23 to 27 in d307fec

if (opt.debug) console.log('utils format() - filtered', filtered);
if (!opt.precision && opt.thousands !== '.' && BigNumber.isValidFloat(filtered)) {
filtered = BigNumber.round(filtered, 0);
if (opt.debug) console.log('utils format() - !opt.precision && isValidFloat()', filtered);
}

Estou usando o input para valores BRL (. para milhar e , para decimal). Inicializando com valores advindos de colunas decimais do MySQL, que faz "trim" dos 0
O problema ocorre ao montar, por exemplo, o valor -17091.2, que seria equivalente a -17091.20, e o componente transforma para -1709.12.

image image

Estou interpretando alguma configuração incorretamente?

@jonathanpmartins
Copy link
Owner

jonathanpmartins commented Feb 20, 2024

Você está usando "v-model" ou "v-model.number"? #38 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants