Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

drop-trailing-zeros-from-decimal python

>>> s = str(Decimal('1500'))
>>> print s.rstrip('0').rstrip('.') if '.' in s else s
1500
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
5+7 =