Skip to content
New issue

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

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

Already on GitHub? # to your account

Number truncated (or not) depending currencySymbol position (num$ or $num) #1071

Open
Jbo31 opened this issue Aug 26, 2024 · 0 comments
Open

Comments

@Jbo31
Copy link

Jbo31 commented Aug 26, 2024

Describe the bug
I use imask to format monetary values depending on the locale.

I have a non consistent behaviour depending on the used mask.

Let's assume I have an input fill with 123456.

I will two masks versions :
V1:RightSymbolPosition{ mask: 'num€', }
V2:LeftSymbolPosition{ mask: '$num',

On the V1 version, 123456€ is displayed.
Insert '7' between 3 and 4. It will result in : 1237. "456" has been truncated. (Would expect 1237456)

On the V2 version, $123456 is displayed.
Insert '7' between 3 and 4. It will result in : 1237456. No truncate.

Depending the position of my currency symbol, behaviour is not consistent.
I would expect for V1 to avoid truncating the end of the value. Would expect to have 1237456.

To Reproduce
Open : https://codepen.io/Jbo31/pen/dyBKNjO
Insert '7' between 3 and 4, in the 2 inputs, result is not consistent.

Will result in 1237 or 1237456 depending the cursor position.

Expected behavior
For that mask 'num€', I would expect not truncating the end of the number.
123456€ is displayed.
Insert '7' between 3 and 4. Would expect 1237456

Environment:

  • OS: Windows
  • Browser Chrome, Firefox
  • IMask Version 7.6.1
  • Pure javascript implementation
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant