diff --git a/src/ifcopenshell-python/ifcopenshell/util/unit.py b/src/ifcopenshell-python/ifcopenshell/util/unit.py index 29561605a4..28bc705f00 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/unit.py +++ b/src/ifcopenshell-python/ifcopenshell/util/unit.py @@ -506,8 +506,8 @@ def convert(value, from_prefix, from_unit, to_prefix, to_unit): :return: The converted value. :rtype: float """ - if from_unit in si_conversions: - value *= si_conversions[from_unit] + if from_unit.lower() in si_conversions: + value *= si_conversions[from_unit.lower()] elif from_prefix: value *= get_prefix_multiplier(from_prefix) if "SQUARE" in from_unit: @@ -515,8 +515,8 @@ def convert(value, from_prefix, from_unit, to_prefix, to_unit): elif "CUBIC" in from_unit: value *= get_prefix_multiplier(from_prefix) value *= get_prefix_multiplier(from_prefix) - if to_unit in si_conversions: - return value * (1 / si_conversions[to_unit]) + if to_unit.lower() in si_conversions: + return value * (1 / si_conversions[to_unit.lower()]) elif to_prefix: value *= 1 / get_prefix_multiplier(to_prefix) if "SQUARE" in from_unit: