When we round off using python is there a way we get answer in 2 decimal place incase if:
round(10.3,2)
It will give 10.3.Is there way so that we get 10.30?
When we round off using python is there a way we get answer in 2 decimal place incase if:
round(10.3,2)
It will give 10.3.Is there way so that we get 10.30?
10.3
is the same number as 10.30
so rounding has nothing to do with it. Try string formatting.
n = 10.3
"{:.2f}".format(n) # classic str.format
f"{n:.2f}" # f-strings in 3.6+