Skip to content

Commit

Permalink
Avoid decimal point and trailing zero for integer BOM quantities (#374)
Browse files Browse the repository at this point in the history
Fixes #340
  • Loading branch information
kvid committed Jul 5, 2024
1 parent 177eb9e commit 668ba72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wireviz/wv_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ 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)),
}
)
Expand Down

0 comments on commit 668ba72

Please sign in to comment.