DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
3+5 =
Submit