Si el argumento es un numero positivo Mathtrunc es equivalente a Mathfloor. JavaScript Math trunc JavaScript trunc is a function used to return the integer portion of a number. The JavaScript math trunc method removes the fractional part of the given number and returns the remaining integer part only.
Since trunc is a static method of Math it can be used without creating an object.
Mathfloor Mathceil and Mathround the way Mathtrunc works is very simple. Mathfloor Mathceil and Mathround the way Mathtrunc works is very simple. Use trunc method in JavaScript to get truncate number. To round off a number in Javascript Mathround1234.