convert double to int javascript code example
Example 1: js convert double to int
var num = 2.9
console.log(parseInt(num, 10)); // 2
Example 2: javascript number length
var num = 1234
number.toString().length; // 4
var num = 2.9
console.log(parseInt(num, 10)); // 2
var num = 1234
number.toString().length; // 4