From 70cd3b1e7af153c97b7fb615cb5c2115f4d827ee Mon Sep 17 00:00:00 2001 From: KV Date: Sun, 2 Jun 2024 20:26:07 +0200 Subject: [PATCH] Avoid decimal point and trailing zero for integer BOM quantities (#374) Fixes #340 --- src/wireviz/wv_bom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wireviz/wv_bom.py b/src/wireviz/wv_bom.py index 27ee59b0..ac6c2b81 100644 --- a/src/wireviz/wv_bom.py +++ b/src/wireviz/wv_bom.py @@ -204,7 +204,7 @@ def generate_bom(harness: "Harness") -> List[BOMEntry]: bom.append( { **group_entries[0], - "qty": round(total_qty, 3), + "qty": int(total_qty) if float(total_qty).is_integer() else round(total_qty, 3), "designators": sorted(set(designators)), } )