U can format that like: "{:.2f}"
I put together a working example in Einblick. https://app.einblick.ai/?w=63f4e322f478ad93f5ab2006
for n in range(0, items, 1): print("\t\t\t", list1[n], end="\t\t\t\t") print("{:.2f}\t{}".format(float(list1[n]) * ratio, list2[n]))the "{:.2f}" format string to specifies that we want to format the float to two decimal places. The f in "{:.2f}" stands for "float", and the .2 specifies that we want two decimal places. The {:} syntax within the curly braces is used to denote the value to be formatted, which results from float(list1[n]) * ratio.
I put together a working example in Einblick. https://app.einblick.ai/?w=63f4e322f478ad93f5ab2006