javascript convert double to int code example
Example 1: js convert double to int
var num = 2.9
console.log(parseInt(num, 10)); // 2
Example 2: get the whole value of a number javascript
var value = 2.9802453587962963;
var wholeNum = Math.floor(value);
console.log(wholeNum); // output ==> 2