Answers for "how to round up floats python"

21

how to round a float in python

round(number, ndigits)
Posted by: Guest on April-12-2020
2

round down decimal python

import math

val = 3.14
math.floor(val) # rounds down --> 3
math.ceil(val) # rounds up val --> 4
Posted by: Guest on June-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language