bitkit icon indicating copy to clipboard operation
bitkit copied to clipboard

[Bug]: Receive Instantly btc/usd toggle can cause the displayed invoice amount to change due to conversion

Open catch-21 opened this issue 11 months ago • 1 comments

Describe the bug

This is a minor UI inconsistency with the expected btc/usd conversion (the smaller value in grey above the input invoice amount) and the displayed input value after toggling between the two denomination.

In the attached screengrab video, the expected conversion from 20000 sats is $14.50 but $14.49 is displayed after toggling unit. Then, even though the displayed input value is lower than minimum, after pressing 'Continue' it displays $14.50 again. When inputting dollar value $14.49 the expected is 19993 sats.

I suspect this is due to rounding on conversion and will probably occur whilst there is no sat/cent parity, but the the btc/dollar conversion should at least be consistent across all views in a given invoice.

Reproduce

  1. Go to 'Receive Instantly'
  2. Input the minimum sat value (20_000)
  3. Toggle to view USD
  4. Observe input value is $14.49 instead of the expected $14.50
  5. It is possible to tap 'Continue' even though the input value is 1 cent lower than the minimum dollar value.

Screenshots / Recording

https://github.com/synonymdev/bitkit/assets/74595920/97a65499-637e-4f4f-8ee9-c33f4827e7e0

Operating system

Android 13 TKQ1.220829.002

Bitkit version

d04af4786fabe20468469a63f76e8c521dea15c1

Log output

No response

catch-21 avatar Mar 14 '24 14:03 catch-21