def almost_equal(val1, val2, places):
    """
    Checks if two values are equal to each other up to a certain number of 
    decimal places.
    
    Args:
      val1: float
      val2: float
      places: int
        The number of decimal places which val1 and val2 must be equal.
        
    Returns:
      True if val1 and val2 are equal up to the number of decimal places 
      specified by places.
    """
    return int(abs(val1 - val2) * 10 ** places) == 0