andelf / tronpy

TRON Python Client Library.
MIT License
212 stars 96 forks source link

How to do the unit conversion? #89

Closed yingshaoxo closed 8 months ago

yingshaoxo commented 1 year ago

In web3.py, there has two functions to do the job: to_wei(quantity, "ether") and from_wei(int(value), 'ether')

In tronpy, what kind of functions that I should use to do the job?

MrNaif2018 commented 1 year ago

I think there are none for now, myself personally I use a generalized and simplified versions of from_wei and to_wei. After all tron only has TRX and sun, no?

MrNaif2018 commented 1 year ago

Would functions like to_sun and from_sun be good enough? @yingshaoxo

MrNaif2018 commented 8 months ago

Closing this for now. @yingshaoxo If you still need this, comment on this issue