There are multiple ways to convert values to integer in javascript. Using Math.trunc gives the most accurate results.
Source code viewerMath.trunc(variable)Programming Language: Javascript