Changes

Jump to: navigation, search

JavaScript Math Object

237 bytes added, 14:13, 18 May 2007
Rounding and Truncating Numbers with the the Math Object
The ''ceil()'', ''floor()'' and ''round()'' methods of the JavaScript Math object can be used to round numbers up and down:
 
'''Math.ceil()''' - Rounds a number up to the nearest integer
 
'''Math.floor()''' - Rounds a number down to the nearest integer
 
'''Math.round()''' - Rounds a number to the nearest integer (i.e up or down depending on which is closest)

Navigation menu