Node.js examples for Math:Math Function
Is int and is percent
function isInt(x) { var y=parseInt(x); if (isNaN(y)) return false; return x==y && x.toString()==y.toString(); } function isPercent(x){ return isInt(x)&&parseInt(x)<=100; }