Math.Round, parseint, Math.floor, and Math.ceil can all return an integer, depending on the difference, see the summary below.
First, Math.Round
Function: Rounding, returning parameter +0.5, rounding down.
Such as:
Math.Round (5.57)//return 6
Math.Round (2.4)//Return 2
Math.Round (-1.5)//return-1
Math.Round (-5.8)//return-6
Second, parseint
Function: Parses a string and returns an integer, which can be simply understood as the integer that returns the fractional part of the parameter.
Such as:
parseint (5.57)//Return 5
parseint (2.4)//Return 2
parseint (-1.5)//return-1
parseint (-5.8)//Return-5
Third, Math.floor
Function: Returns the largest integer less than or equal to the parameter.
Such as:
Math.floor (5.57)//Return 5
Math.floor (2.4)//Return 2
Math.floor (-1.5)//Return-2
Math.floor (-5.8)//return-6
Iv. Math.ceil
Function: Returns the smallest integer greater than or equal to the parameter
Math.ceil (5.57)//return 6
Math.ceil (2.4)//Return 3
Math.ceil (-1.5)//return-1
Math.ceil (-5.8)//Return-5
Summary of Math.Round, parseint, Math.floor and Math.ceil decimal rounding in JS