ngx-currency icon indicating copy to clipboard operation
ngx-currency copied to clipboard

Select All (e.g. Ctrl+A) then a Number is 0.X instead of 0.0X (sometimes)

Open cameronleger opened this issue 5 years ago • 3 comments

  1. https://nbfontana.github.io/ngx-currency/
  2. 0.00 is the default
  3. Select-All inside the input
  4. Key-in a Number, like 5
  5. The value is now 0.5 (whereas 0.05 is expected)
  6. Key-in more Numbers, like 4321
  7. The value is now 543.21
  8. Select-All inside the Input
  9. Key-in a Number, like 5
  10. The value is now 0.05 (as expected!)

So, it seems that if the value is currently 0, there is some unexpected behavior when the entire value is modified to something else. It's especially interesting if you try the Number 0, which results in a 0.0 and not 0.00.

ngccurrency-bug

cameronleger avatar May 28 '20 21:05 cameronleger

Same problem here. I'm working with precision 8

hamonCordova avatar Jun 17 '20 12:06 hamonCordova

Well there's not a lot of chatter about it, but I will probably start working on this soon if I have more time.

cameronleger avatar Jun 17 '20 14:06 cameronleger

Hi,

Thank you for all the work you put into the development of the project. I observe something similar to the reported issue.

Steps to reproduce:

  1. Go to the demo app - https://nbfontana.github.io/ngx-currency/
  2. Enter a value, for example, 12345
  3. Remove the value
  4. Paste a value, for example, 12.345.678.901,23
  5. Component value is now 12345678.9 (12.345.678.901,23 is expected)

ezgif com-video-to-gif (1)

a-kardas avatar Jan 11 '21 08:01 a-kardas