def round_ans(val): """ Rounds numbers to 2 decimal places. :param val: Number to be rounded :return: String of number rounded to 2 decimal places """ return "{:.2f}".format(val) def cm_to_inches(val): """ Converts centimeters to inches. :param val: Value in cm :return: Converted value in inches (string) """ return round_ans(val / 2.54) def m_to_feet(val): """ Converts meters to feet. :param val: Value in meters :return: Converted value in feet (string) """ return round_ans(val * 3.28084) def km_to_miles(val): """ Converts kilometers to miles. :param val: Value in km :return: Converted value in miles (string) """ return round_ans(val * 0.621371)