Section 24.121. Math.round( ): round to the nearest integer


24.121. Math.round( ): round to the nearest integer

ECMAScript v1

24.121.1. Synopsis

 Math.round(x) 

24.121.1.1. Arguments

x

Any number.

24.121.1.2. Returns

The integer closest to x.

24.121.2. Description

Math.round( ) rounds its argument up or down to the nearest integer. It rounds .5 up. For example, it rounds 2.5 to 3 and rounds -2.5 to -2.




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net