Skip to content

Commit

Permalink
pick number of days from variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cibinmathew authored Dec 10, 2022
1 parent 5d5b5f2 commit 06cc8c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def report_cost(group_by: str = "SERVICE", length: int = 5, result: dict = None,
service_names = [k for k,_ in most_expensive_yesterday[:length]]
longest_name_len = len(max(service_names, key = len))

buffer = f"{'Service':{longest_name_len}} ${'Yday':8} {'∆%':>5} {'Last 7d':7}\n"
buffer = f"{'Service':{longest_name_len}} ${'Yday':8} {'∆%':>5} {'Last '}{n_days}{'d':7}\n"

for service_name, costs in most_expensive_yesterday[:length]:
buffer += f"{service_name:{longest_name_len}} ${costs[-1]:8,.2f} {delta(costs):4.0f}% {sparkline(costs):7}\n"
Expand Down

0 comments on commit 06cc8c0

Please sign in to comment.