Mar-17-2017, 09:31 PM
Quote:what's the simplest way to limit the output to one decimal place using my code?
utilize the format method
>>> value = 0.60000000000000001 >>> '{:.1}'.format(value) '0.6'
Recommended Tutorials:
Error in Python 3.6 and how to limit decimal places
|
|
Messages In This Thread |
Error in Python 3.6 and how to limit decimal places - by Raptor88 - Mar-17-2017, 09:24 PM
RE: Error in Python 3.6 and how to limit decimal places - by metulburr - Mar-17-2017, 09:31 PM
RE: Error in Python 3.6 and how to limit decimal places - by ichabod801 - Mar-17-2017, 09:38 PM
RE: Error in Python 3.6 and how to limit decimal places - by snippsat - Mar-17-2017, 09:47 PM
RE: Error in Python 3.6 and how to limit decimal places - by Raptor88 - Mar-17-2017, 10:38 PM
RE: Error in Python 3.6 and how to limit decimal places - by snippsat - Mar-17-2017, 10:54 PM
RE: Error in Python 3.6 and how to limit decimal places - by Raptor88 - Mar-18-2017, 05:02 AM
|