This commit is contained in:
Andrej730
2025-10-29 12:29:01 +05:00
parent 3f2cad0490
commit e8ece71d22
@@ -225,10 +225,10 @@ class FormatTransformer(lark.Transformer):
if not args: if not args:
return True return True
token = args[0] token = args[0]
if hasattr(token, 'type'): if hasattr(token, "type"):
return token.type == 'TRUE' return token.type == "TRUE"
value = str(token).lower() value = str(token).lower()
if hasattr(token, 'value'): if hasattr(token, "value"):
value = str(token.value).lower() value = str(token.value).lower()
return value in ("true", "1", "yes") return value in ("true", "1", "yes")
@@ -277,11 +277,12 @@ class FormatTransformer(lark.Transformer):
output_unit = "inch" if output_unit == "inch" else "foot" output_unit = "inch" if output_unit == "inch" else "foot"
return ifcopenshell.util.unit.format_length( return ifcopenshell.util.unit.format_length(
float(value), int(precision), float(value),
int(precision),
suppress_zero_inches=suppress_zero_inches, suppress_zero_inches=suppress_zero_inches,
unit_system="imperial", unit_system="imperial",
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit output_unit=output_unit,
) )
def int(self, args: list[str]) -> str: def int(self, args: list[str]) -> str: