To achieve the desired result of removing the decimal portion, you have a few options in JavaScript. You could utilize the Math.floor() function to round down, Math.ceil() to round up, or Math.round() to round to the nearest integer.
If truncating the decimal is all you're after, consider using bitwise operators such as |0 which treats the operand as a signed 32bit integer.
It's also worth noting the potential inaccuracies that can arise due to floating point arithmetic when working with decimals.
For further insights into this topic, I recommend checking out the "Required Reading" link provided below.
Best regards,
Siva