I would like to round the float to the next even number.
Steps:
1) check if the number is odd or even
2) if odd, rounded to the next even number
I have ready step 1, a function that checks if the number of pressures is even or not:
def is_even(num): if int(float(num) * 10) % 2 == 0: return "True" else: return "False"
but I'm afraid with step 2 ....
Any tips?
Note: all floats will be positive.
source share