pub fn trunc(x: f64) -> f64
The Math.trunc() function returns the integer part of a number by removing any fractional digits.
Math.trunc()
MDN documentation