File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,14 @@ def render_header(financial_data, financial_calculations):
53
53
f"### { stock_info ['symbol' ]} - { stock_info ['longName' ]} " , unsafe_allow_html = True
54
54
)
55
55
# Render price change
56
- current_price = stock_info ["currentPrice" ]
57
- previous_close_price = stock_info ["previousClose" ]
56
+ current_price = float ( stock_info ["currentPrice" ])
57
+ previous_close_price = float ( stock_info ["previousClose" ])
58
58
currency_symbol = financial_calculations ["currency_symbol" ](stock_info ["currency" ])
59
- current_price_content = f"{ currency_symbol } { current_price } "
59
+ current_price_content = f"{ currency_symbol } { current_price :.2f } "
60
60
price_diff = financial_calculations ["percentage_value_change" ](
61
61
current_price , previous_close_price
62
62
)
63
- price_diff_content = f"({ price_diff :.2 } %)"
63
+ price_diff_content = f"({ price_diff :.2f } %)"
64
64
price_change_content = (
65
65
apply_text_color (price_diff_content , "red" )
66
66
if price_diff < 0
You can’t perform that action at this time.
0 commit comments