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
A bit old but to put another way in to the pot:
Math.trunc();
see here for details.