def to_satoshis(input_quantity, input_type):
    assert input_type in UNIT_CHOICES, input_type

    # convert to satoshis
    if input_type in ('btc', 'mbtc', 'bit'):
        satoshis = float(input_quantity) * float(UNIT_MAPPINGS[input_type]['satoshis_per'])
    elif input_type == 'satoshi':
        satoshis = input_quantity
    else:
        raise Exception('Invalid Unit Choice: %s' % input_type)

    return int(satoshis)
convert to satoshis, no rounding
dataset/ETHPy150Open blockcypher/blockcypher-python/blockcypher/utils.py/to_satoshis