import decimal


def _float_to_satoshi(float_val):
    """Convert value from BTC (decimal) to satoshis integer.
    This works fine on my machine in python3:
        >>> int(round(decimal.Decimal(0.00000001) * decimal.Decimal(1e8)))
        1
        >>> int(round(decimal.Decimal(87654321.12345678) * decimal.Decimal(1e8)))
        8765432112345678
    """
    return int(round(decimal.Decimal(float_val) * decimal.Decimal(1e8)))