Hot answers tagged


It is not posible for all cases unless totalA equals totalB in which case you will have amountB = amountA. The division truncates the result discarding decimals digits, in your example the return value of convertBtoA should be 163813609331349736.27117520077928403. For most use cases small rounding errors are accepted, for example ERC20 and Ether both have ...

Only top voted, non community-wiki answers of a minimum length are eligible