def shorten_amount(amount):
    ' Given an amount in bitcoin, shorten it\n    '
    amount = int((amount * (10 ** 12)))
    units = ['p', 'n', 'u', 'm']
    for unit in units:
        if ((amount % 1000) == 0):
            amount //= 1000
        else:
            break
    else:
        unit = ''
    return (str(amount) + unit)
Given an amount in bitcoin, shorten it
def shorten_amount(amount):
    ' \n    '
    amount = int((amount * (10 ** 12)))
    units = ['p', 'n', 'u', 'm']
    for unit in units:
        if ((amount % 1000) == 0):
            amount //= 1000
        else:
            break
    else:
        unit = 
    return (str(amount) + unit)