'Return value forced within range'

def minimax(self, val, default, low, high):

    val = self.to_int(val, default=default)
    if (val < low):
        return low
    if (val > high):
        return high
    return val
