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

InputNumber: Incorrect formatting when in decimal mode with a suffix (maybe all the time) #3382

Closed
Ancient-Dragon opened this issue Dec 7, 2022 · 6 comments · Fixed by #3999
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Ancient-Dragon
Copy link
Contributor

Describe the bug

It seems that when formatting an input number the logic is wrong, the method: concatValues here. Has an issue when it calcalates val1 it determines 5 and then val2 is 05 so it works out to 5 + 5 + suffix whereas it should be 0 + 5 + suffix. It should be 0 + 5 + suffix. Hope that makes sense.

We have this issue with vite, but I can also see it's an issue on the main website which uses the vue cli.

Reproducer

https://www.primefaces.org/primevue/inputnumber

PrimeVue version

3.20.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

Any

Steps to reproduce the behavior

Go to the temperature input in the docs and select all, and type 05 and it will replace it with 55.

Expected behavior

When typing 05 for it stay 05 not 55.

@Ancient-Dragon Ancient-Dragon added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 7, 2022
@melloware
Copy link
Member

Similar issue in PrimeReact: primefaces/primereact#2871

@hurahurat
Copy link

When typing 2000 with suffix in the InputNum it shows 20.000. And when I type a long number it shows 0 instead of the number I had typed.

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 14, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.x milestone Dec 14, 2022
@anohabbah
Copy link

When typing 2000 in currency mode, it formats to 20 000 €. Example :

<InputNumber v-model="nocents" locale="fr-FR" mode="currency" currency="EUR" :min-fraction-digits="0" :max-fraction-digits="0" placeholder="Cents are not allowed..."/>

This does not occur when you remove min/max fraction digits props.

@DurinMusicspear
Copy link

We also have problems with this, do we really need to wait for 3.x for this to be fixed?

@meveno
Copy link

meveno commented Mar 28, 2023

You can test the bug directly on primevue website :
https://primevue.org/inputnumber/#currency

Use the germany field in Euro.

@denisbraud
Copy link

Test Ko in 3.29.1

Steps to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants