import math


def myround(x, base, choice=None):
    """
    Round values to the nearest base

    :type x: float
    :param x: value to round
    :type base: int
    :param base: nearest number to round to
    :type choice: str
    :param choice: 'up' to round up, 'down' to round down, or None for nearest
    """
    if choice == "up":
        fx = math.ceil
    elif choice == "down":
        fx = math.floor
    else:
        fx = round
    return int(base * fx(float(x) / base))