Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

[BUG] 4 decimal is not enough for crypto #3287

Closed
1 task done
Jack-Works opened this issue Jul 7, 2024 · 8 comments · Fixed by #3324 or #3334
Closed
1 task done

[BUG] 4 decimal is not enough for crypto #3287

Jack-Works opened this issue Jul 7, 2024 · 8 comments · Fixed by #3324 or #3334
Assignees
Labels
approved Approved by the Ivy Wallet team. Ready for dev bug Something isn't working good first issue Good for newcomers

Comments

@Jack-Works
Copy link
Contributor

Please confirm the following

Describe the bug

image

The exchange rate cannot have more than 4 decimals, so when exchanging JPY for BTC (1 JPY = 0.00000011 BTC), it cannot work correctly.

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

App version

2024.07.06 (181)

Smartphone

No response

Additional context

No response

@Jack-Works Jack-Works added the bug Something isn't working label Jul 7, 2024
@ivywallet
Copy link
Collaborator

Thank you @Jack-Works for raising Issue #3287! 🚀
What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

@suyash01
Copy link
Contributor

I'm on it

@ivywallet
Copy link
Collaborator

Thank you for your interest @suyash01! 🎉
Issue #3287 is assigned to you. You can work on it! ✅

If you don't want to work on it now, please un-assign yourself so other contributors can take it.

Also, make sure to read our Contribution Guidelines.

@suyash01
Copy link
Contributor

@ILIYANGERMANOV just changing the decimal place will change it for every currency and usually crypto like ETH can have upto 18 decimal places. So, I was thinking to maintain 2 decimal places - one for crypto and one for normal currency.
However, we don't store the type of currency in either account or exchange rate table. what are your thoughts on this?

@ILIYANGERMANOV
Copy link
Collaborator

Hey @suyash01 we have an IvyCurrency class that can differentiate between those. Just create a Set of all supported crypto in Ivy Wallet and if the currency is in that set => use crypto decimals. Also, the UI won't properly display 18 places 😬

@suyash01
Copy link
Contributor

Ok, from UI perspective I am putting the exchange rate to a new line to prevent wrapping.

@Jack-Works
Copy link
Contributor Author

hi! I'm afraid this issue is not solved. When you edit the exchange rate, you're still being limited to 4 decimals. Please reopen this thank you! cc @ILIYANGERMANOV

@ILIYANGERMANOV
Copy link
Collaborator

@suyash01 can you have a look when editing exchange rates?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Approved by the Ivy Wallet team. Ready for dev bug Something isn't working good first issue Good for newcomers
Projects
None yet
4 participants