python round to nearest decimal code example
Example 1: round to the nearest integer python
int(round(x))
Example 2: round down decimal python
import math
val = 3.14
math.floor(val) # rounds down --> 3
math.ceil(val) # rounds up val --> 4
int(round(x))
import math
val = 3.14
math.floor(val) # rounds down --> 3
math.ceil(val) # rounds up val --> 4