zecwalletco / zecwallet-mobile

Zecwallet Android and iOS apps
10 stars 11 forks source link

"Invalid Amount!" and unable to calculate USD price due to incorrect parsing #56

Open rex4539 opened 2 years ago

rex4539 commented 2 years ago

Steps:

  1. Go to https://zecpages.com/z/all
  2. In one of the polls, select "Yes" or "No" and then click on "Vote".
  3. Using ZecWallet mobile, tap on "SEND" and then on the QR code scanner.
  4. Scan the QR code.

What happened: You get "Invalid Amount!" error and the USD price is zero (not calculated).

IMG_8223

In order to force the app to accept the amount, you need to delete all the characters and retype the amount manually. And even then the USD amount is sometimes calculated and sometimes not. So there is obviously a parsing bug.

Expected result: Amount is parsed correctly and USD price is always updated when amount is shown or typed.

pacu commented 2 years ago

I was about to report this problem. It's a number formatter locale issue.

To reproduce the bug: set you phone's locale to a language that uses a comma (,) as a decimal separator for numbers, like Spanish.

Reproducing Side-effect 1) (invalid amount) Try to fill transaction amount using USD converter. the amount will be expressed with the point as decimal separator. this will cause the parsing error. You will see how I typed 200 and the amount is 1 point 19 something

image

reproducing Side-effect 2) wrong USD conversion try to fill the amount in ZEC on the left. The transaction info will be valid, but the USD conversion will be broken observe how I typed a similar amount that should be somewhere near 200 but instead it's just the current value of 1 ZEC

IMG_B088083B0F2A-1