1function float2int (value) {
2 return value | 0;
3}
4
5float2int(3.75); //3 - always just truncates decimals
6
7//other options
8Math.floor( 3.75 );//3 - goes to floor , note (-3.75 = -4)
9Math.ceil( 3.75 ); //4 - goes to ceiling, note (-3.75 = -3)
10Math.round( 3.75 );//4