def to_token_decimals(amount, decimals): amount = str(amount) if '.' in amount: decimals -= len(str(amount).split('.')[1]) return int(str(amount).replace('.', '') + '0' * decimals)
Return the amount with specified number of zeros casted as an integer