fix(fred): state the dates a macro change spans (#1397)

- the change line reads "Change from <first> to <last>" instead of "Change over window", so a partial-year move no longer reads as year on year
This commit is contained in:
Yijia-Xiao
2026-09-24 18:45:44 +00:00
parent f4269bf193
commit f9d6495dca
2 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -254,8 +254,8 @@ def get_macro_data(
pct = f" ({delta / base * 100:+.2f}%)" if base != 0 else ""
summary = (
f"\n**Latest:** {last_val} ({last_date}) | "
f"**Change over window:** {delta:+.2f}{pct} "
f"from {first_val} ({first_date})\n"
f"**Change from {first_date} to {last_date}:** {delta:+.2f}{pct}, "
f"from {first_val}\n"
)
except ValueError:
summary = f"\n**Latest:** {last_val} ({last_date})\n"