Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Deposit amount in DB is greater than Amount on Blockchain #2805

Open
martianatwork opened this issue Jan 25, 2021 · 3 comments
Open

Deposit amount in DB is greater than Amount on Blockchain #2805

martianatwork opened this issue Jan 25, 2021 · 3 comments

Comments

@martianatwork
Copy link

If someone deposits a specific amount in USD ex. $5 or $500, In some cases the Blockchain amount will contain many decimals, ex. "0.055796386110991888".
In this case the DB amount will appear as "0.0557963861109919". This is not an issue on DB but the collection fails, Which is pain when we have more than 100 active customers.

I will be happy to submit a PR.

@krtschmr
Copy link

what exactly is the problem? i would suggest to either truncate the deposit or round a 4.9999x$ deposit up to 5.

@martianatwork
Copy link
Author

@krtschmr I think you missed the point, system is rounding the amount but it is rounding up instead of rounding down.
Amount: 0.58995
Precision: 2

Case "rounding up":
Amount: 0.59

Case "rounding down":
Amount: 0.58

you see if we round up, the amount will be greater than actual deposit and cause issue on blockchain when collecting as the amount on the blockchain is 0.58995 but in the system amount will be 0.59 and system will try to collect 0.59.

@antonDigitalMagic
Copy link

I’ve described this issue in more details and opened PR in #2851

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants