strip decimal points from variable
use parseInt();
parseInt("1.25");//returns 1
parseInt("1.85");//returns 1
parseInt(1.25);//returns 1
parseInt(1.85);//returns 1
Simply...
Math.round(quantity);
...assuming you want to round 1.7
to 2
. If not, use Math.floor
for 1.7
to 1
.