Skip to content

Commit ab7a687

Browse files
committed
Fix string formatting
1 parent 9bf22bc commit ab7a687

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

investing_algorithm_framework/app/reporting/tables/time_metrics_table.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,16 @@ def create_html_time_metrics_table(results, report):
2525
if isinstance(copy_results['worst_month'], tuple):
2626
percentage = copy_results['worst_month'][0]
2727
date = copy_results['worst_month'][1]
28-
copy_results['Worst Month'] = f"{safe_format_percentage(
29-
percentage, '{:.2f}'
30-
)}% {safe_format_date(date, '%b %Y')}"
28+
copy_results['Worst Month'] = f"{safe_format_percentage(percentage, string_format)}% {safe_format_date(date, '%b %Y')}"
3129

3230
if isinstance(copy_results['best_year'], tuple):
3331
percentage = copy_results['best_year'][0]
3432
date = copy_results['best_year'][1]
35-
copy_results['Best Year'] = f"{safe_format_percentage(
36-
percentage, string_format
37-
)}% {safe_format_date(date, '%b %Y')}"
33+
copy_results['Best Year'] = f"{safe_format_percentage(percentage, string_format)}% {safe_format_date(date, '%b %Y')}"
3834
if isinstance(copy_results['worst_year'], tuple):
3935
percentage = copy_results['worst_year'][0]
4036
date = copy_results['worst_year'][1]
41-
copy_results['Worst Year'] = f"{safe_format_percentage(
42-
percentage, string_format
43-
)}% {safe_format_date(date, '%b %Y')}"
37+
copy_results['Worst Year'] = f"{safe_format_percentage(percentage, string_format)}% {safe_format_date(date, '%b %Y')}"
4438

4539
stats = {
4640
"Metric": [

0 commit comments

Comments
 (0)