python remove trailing zeros from decimal code example
Example 1: remove trailing zeros python
var = round(var, 1) #the first value is the number or var
#to round, the second is what desimal to round to
Example 2: drop-trailing-zeros-from-decimal python
>>> s = str(Decimal('1500'))
>>> print s.rstrip('0').rstrip('.') if '.' in s else s
1500