Closed benkaiser closed 3 years ago
I think i got this, sometimes it uses 5 decimals and sometimes 6. Shall i make 6 the standard?
@bitrequest can we just make it as granular as the value is (i.e. show the number up to however many decimals are non+zero)?
I think 6 decimals is good, otherwise it can go up to more then 20 decimals (When converted via Xchange rates). Which is not really userfriendly. And not practical for the UX.
@bitrequest will the 6 decimals always match what is shown with the QR code? I'm just concerned with the change in logic for exact
payments, that they may not match up
(just to add, the other reason I like more decimals is that I plan on passing small differences in USD amounts to make the transactions more likely to be unique, and for BTC 6 decimals is almost 4 cents difference in USD price)
If someone pays the exact amount from input or QR i'm pretty sure they will match. Gonna round the receiving amount to 6 decimals as well and it should be a 100% match. More then 6 decimals is only relevant for BTC at the moment cause of it's high price relative to the other crypto's but even that should be enough for now i think. And i've tested with 8 decimals and it starts having rendering problems. Think i will need to implement big number libraries for that. Which is not something i want to do in the short term.
Ok i tested on all coins and had 100% match each time! (6 decimal standard) https://github.com/bitrequest/bitrequest.github.io/commit/5e6a7c82989df5ca01dc0bbe84f0ecefa5af29e9
Perfect, thanks @bitrequest !
I noticed that the request window shows a rounded amount:
The raw amount that actually gets requested in the QR code is 0.446323.
I'm concerned if a user is manually making a payment (rather than scanning the QR code / clicking the open in wallet button), then they will send slightly the wrong amount and the payment will fail in
exact
mode.Would you be happy with a PR to show the number of digits that are non-zero?