This question already has answers here:
Closed 8 years ago.
Possible Duplicate:
How can I round of to whole numbers in JavaScript?
In javascript is there a function which allows me to round to the nearest integer? Either up or down.
So:
2.1 = 2
2.9 = 3
4.5 = 5
1.1 = 1