I have a string variable containing .10 I would like to format it to print out 0.10.
Is there a way I could somehow pass the desired string format to the variable and the variable formats accordingly.
ex.
.10 becomes 0.10 (formatting 0.00)
.10 becomes 0.100 (formatting 0.000)
50.10 becomes 50.1 (formatting 0.0)
the version of python that I use is 2.4.