How do I change a number like 3.3 to 3.30 to represent currency in python? does this include using round()? The code running The code
I want the 5.3 to be 5.30 and if it is 2 I want it to be 2.00.
How do I change a number like 3.3 to 3.30 to represent currency in python? does this include using round()? The code running The code
I want the 5.3 to be 5.30 and if it is 2 I want it to be 2.00.
You should take a look at float string formatting documentaiton.
In your case this will work.
'{:.2f}'.format(3)