You can convert a floating-point number to an integer using several methods. Some common ones include:
Math.floor() -
let num = 4.7;
let result = Math.floor(num); // result will be 4
Math.ceil() -
let num = 4.3;
let result = Math.ceil(num); // result will be 5
Math.round() -
let num = 4.5;
let result = Math.round(num); // result will be 5