Answers for "rounding with .2g gives strange results"

0

rounding with .2g gives strange results

>>> "%g" % round(20.016, 2)
'20.02'
>>> "%g" % round(20, 2)
'20'
Posted by: Guest on June-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language