var value = 0.04; var output = value == parseInt(value) ? value : parseInt(value+1); console.log(output); // 1