js convert double to int

JavaScript
var num = 2.9
console.log(parseInt(num, 10)); // 2
Source

Also in JavaScript: