The JavaScript function parseInt can be used to force conversion of a given parameter to an integer, whether that parameter is a string, float number, number, etc.
parseInt
Why would you use parseInt in this case? Just use Math.floor or Math.ceil. parseInt expects a string as an argument and not a number. Hence your error
Math.floor
Math.ceil