def toWei(self, amount, unit='ether', decimals=18):
    if (Web3 is None):
        self.raise_error(NotSupported, details='ethereum web3 methods require Python 3: https://pythonclock.org')
    if (amount is None):
        return amount
    if (decimals != 18):
        if (decimals % 3):
            amount = (Decimal(amount) / Decimal((10 ** (18 - decimals))))
        else:
            unit = self.eth_unit(decimals)
    return str(Web3.toWei(amount, unit))
def toWei(self, amount, unit='ether', decimals=18):
    if (Web3 is None):
        self.raise_error(NotSupported, details='ethereum web3 methods require Python 3: https://pythonclock.org')
    if (amount is None):
        return amount
    if (decimals != 18):
        if (decimals % 3):
            amount = (Decimal(amount) / Decimal((10 ** (18 - decimals))))
        else:
            unit = self.eth_unit(decimals)
    return str(Web3.toWei(amount, unit))