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/12/19 07:52,
3.137.163.165: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://massmind.org/techref/language/JAVA/SCRIPT/definitive/refp_240.htm"> [Chapter 21] Reference: Math.round()</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.