DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
rounding with .2g gives strange results
>>> "%g" % round(20.016, 2) '20.02' >>> "%g" % round(20, 2) '20'
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#rounding
#strange
#results
ADD COMMENT
Topic
COMMENT
Name
9+5 =
Submit