Streamlit - trailing zeroes

24 Views Asked by At

I have a dashboard that I have created using streamlit and I am facing the issue of trailing zeroes even after applying the the following

comb_target_ach = [round(float(x),1) for x in comb_target_ach]
comb_target_ach = [round(x,2) for x in comb_target_ach]

it looks like it in the image.

Please help

on the console, if I print it I get it up to two decimal places but not in streamlit

additionally, if I use this

comb_target_ach = [f"{x:.2f}" for x in comb_target_ach]

it shows upto two decimal places but messes up with the logic for coloring

enter image description here

0

There are 0 best solutions below