I need to display trailing zeros in a decimal number. I have consider using python format() but it returns a string and when I convert it to float or decimal the trailing zero disappears.
I have also tried using python decimal but it returns a Decimal instance on variable assignment. For example:
>>> x = decimal.Decimal(format(15.2, '.2f'))
>>> print x
15.20
>>> x
Decimal('15.20')
Python version: 2.7
I need to display 15.2 as 15.20 (not as '15.20' << string type)
Thanks In Advance