Converting float to integer (trunc)



let pi = 3.14;
var intvalue = Math.round( pi );

// `Math.trunc` was added in ECMAScript 6
var intvalue = Math.trunc( pi );