Navigator 2.0, Internet Explorer 3.0
Math.round(x)
Any number or numeric expression
The integer closest to x.
Math.round() rounds its argument up or down to the nearest integer.
In Navigator 2.0, Math.round() did not correctly round very large numbers. The following workaround can be used:
function my_round(num) { var fl = Math.floor(num); var ce = Math.ceil(num); return (fl == ce) ? num : ((num - fl) < (num - ce)) ? fl : ce; }
This HTML Help has been published using the chm2web software. |