Have dimensions like 4' - 1/2" read like 4' - 0 1/2", as is more the convention.

This commit is contained in:
Ryan Schultz
2025-11-23 18:22:40 -06:00
parent 592c51b526
commit 97a501036b
@@ -773,8 +773,9 @@ def format_length(
if output_unit == "foot":
return f"{feet}' - {whole} {remainder}/{frac.denominator}\""
return f'{(feet * 12) + whole} {remainder}/{frac.denominator}"'
# When we have a proper fraction (numerator < denominator), show "0 frac"
if output_unit == "foot":
return f"{feet}' - {frac.numerator}/{frac.denominator}\""
return f"{feet}' - 0 {frac.numerator}/{frac.denominator}\""
return f'{feet * 12} {frac.numerator}/{frac.denominator}"'
elif unit_system == "metric":
rounded_val = round(value / precision) * precision