Friday, May 20, 2011

round() method

The round() method rounds decimal numbers to the nearest integer.

Browser support: all
Original TheMadScript Version: 1.0.0
Newer Version: Version 2.0.0

Syntax: round(integer,result);

Note: You do not have to use quotes for the integer.

The following syntax below displays an alert box that will tell you what 10.6 rounds to.

round(10.6,"box_alert('10.6 rounds to '+num_rnd+'.'");

No comments:

Post a Comment