Use the Math.ceil
[MDN] function
var n = 4.3;
alert(Math.ceil(n)); //alerts 5
More Related Contents:
- Get decimal portion of a number with JavaScript
- How do I round a number in JavaScript?
- JavaScript: Round to a number of decimal places, but strip extra zeros
- How to round to at most 2 decimal places, if necessary?
- Format number to always show 2 decimal places
- Formatting a number with exactly two decimals in JavaScript
- Large numbers erroneously rounded in JavaScript
- Using bitwise OR 0 to floor a number
- How does JavaScript determine the number of digits to produce when formatting floating-point values?
- How to convert string into float in JavaScript?
- How can I round a number in JavaScript? .toFixed() returns a string?
- Truncate (not round off) decimal numbers in javascript
- JavaScript displaying a float to 2 decimal places
- Is there a way to round numbers into a reader friendly format? (e.g. $1.1k) [closed]
- How to handle floats and decimal separators with html5 input type number
- Gaussian/banker’s rounding in JavaScript
- In jQuery, what’s the best way of formatting a number to 2 decimal places?
- In JavaScript, why does zero divided by zero return NaN, but any other divided by zero return Infinity?
- Does JavaScript have double floating point number precision?
- How can I round down a number in Javascript?
- Float sum with javascript [duplicate]
- BigDecimal in JavaScript
- Javascript: Round up to the next multiple of 5
- Rounding numbers to 2 digits after comma
- How can I round to whole numbers in JavaScript?
- Is there a reliable way in JavaScript to obtain the number of decimal places of an arbitrary number?
- 1.265 * 10000 = 126499.99999999999? [duplicate]
- Javascript float subtract
- round off decimal using javascript
- How do you round to one decimal place in JavaScript?