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 =index.html Math.floor(num); var ce = Math.ceil(num); return (fl == ce) ? num : ((num - fl) < (num - ce)) ? fl : ce; }
file: /Techref/language/JAVA/SCRIPT/definitive/refp_240.htm, 4KB, , updated: 2019/10/14 15:00, local time: 2024/11/23 04:52,
18.221.93.167:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/techref/language/JAVA/SCRIPT/definitive/refp_240.htm"> [Chapter 21] Reference: Math.round()</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.