Fix salary tool edge cases (#75)

* fix: handle salary tool edge cases

* fix: preserve Danish salary compounds
This commit is contained in:
Kushida
2026-07-08 21:12:36 +02:00
committed by GitHub
parent d4415dff16
commit 9e26de2c67
4 changed files with 68 additions and 10 deletions
+5 -2
View File
@@ -204,12 +204,15 @@ def format_entry(entry, metadata):
count = data.get("count")
index = data.get("index")
if count is not None or index is not None:
count_str = str(count) if count else "-"
if index is not None:
count_str = str(count) if count is not None else "-"
if isinstance(index, (int, float)):
diff = index - baseline
sign = "+" if diff >= 0 else ""
index_str = f"{index:.1f}"
diff_str = f"{sign}{diff:.1f}%"
elif index is not None:
index_str = str(index)
diff_str = ""
else:
index_str = "N/A*"
diff_str = ""