@ -48,4 +48,8 @@ def format_amount(value, token, chain_id):
decimals = 18
suffix = networks.suffix_by_chain_id(chain_id)
return '%s %s' % (value // 10 ** decimals, suffix)
d = pow(10, decimals)
value = ('%d.%0*d' % (value // d , decimals, value % d)).rstrip('0')
if value.endswith('.'):
value += '0'
return '%s %s' % (value, suffix)
@ -8,7 +8,11 @@ from apps.common.confirm import hold_to_confirm
def format_amount(amount, coin):
return '%s %s' % (amount / 1e8, coin.coin_shortcut)
d = pow(10, 8)
amount = ('%d.%08d' % (amount // d , amount % d)).rstrip('0')
if amount.endswith('.'):
amount += '0'
return '%s %s' % (amount, coin.coin_shortcut)
def split_address(address):