drop trailing zeros from decimal python

Solutions on MaxInterview for drop trailing zeros from decimal python by the best coders in the world

showing results for - "drop trailing zeros from decimal python"
Serena
10 Nov 2016
1>>> s = str(Decimal('1500'))
2>>> print s.rstrip('0').rstrip('.') if '.' in s else s
31500