I have this:
a = "2.10"
print float(a)
Where output is:
2.1
But I need output as it is.
2.10
I have this:
a = "2.10"
print float(a)
Where output is:
2.1
But I need output as it is.
2.10
You can use the .2f
format for this:
a = "2.10"
print "%.2f" % float(a)
Output:
2.10