You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
Hi @shamatar,
When I want to show BigUInt value in String format, I use formatToEthereumUnits function on Web3+Utils.swift, It work correctly but there is a problem, we should set manually the decimals value and usually we don't know the number of digit on it.
for example when we got wallet balance, its value is 220000000000000 in wei and if we want convert in to .eth we should specific the decimals manually, if we set 18 it return 0.000220000000000000
if we set 4 it returns 0.0002 how we can omit 0 digit at the end of the balance automatically.
Is there any function to do this? (omit the zero number at the end of the balance)
The text was updated successfully, but these errors were encountered:
No, the existing function can no do it, you should use some standard Swift functionality to do it. If at some point you make a nice function that you think should be used for everyone - just submit a PR.
Hi @shamatar,
When I want to show BigUInt value in String format, I use formatToEthereumUnits function on Web3+Utils.swift, It work correctly but there is a problem, we should set manually the decimals value and usually we don't know the number of digit on it.
for example when we got wallet balance, its value is 220000000000000 in wei and if we want convert in to .eth we should specific the decimals manually, if we set 18 it return 0.000220000000000000
if we set 4 it returns 0.0002 how we can omit 0 digit at the end of the balance automatically.
Is there any function to do this? (omit the zero number at the end of the balance)
The text was updated successfully, but these errors were encountered: