Consider we have the following number:
const num = 13.456
Now we need to remove the decimal part from the above number and print it like this:
Here is an example:
const num = 109.42; console.log(parseInt(num));
Alternatively, we can also use the
const num = 109.42; console.log(Math.trunc(num));
Math.trunc() function doesn’t support on Internet explorer.