Mar-26-2019, 09:14 PM
(This post was last modified: Mar-26-2019, 09:14 PM by ClassicalSoul.)
Hi, I was wondering how I could make string.format round to the left of the decimal.
Thanks
>>> x = 4. 542412343 >>> '{0} rounded to {1} decimals is {2: .1f}'.format(x, 4, x) >>> 4.5
>>> x = 52137809 >>> '{0} rounded to {1} decimals is {2: ???}'.format(x, 4, x) >>> 50000000Moreover, is there somewhere I could have accessed this information, like the help function?
Thanks