View Full Version : Rounding Numbers
Lucky13
July 3rd, 2001, 20:56
I need to know how to round a decimal to the nearest whole number. If anyone can help me, I would really appreciate it. Thanks.
~Lucky13
lucifer
July 4th, 2001, 05:01
JavaScript
x=Math.round(x)
Perl
$x=sprintf("%d",$x + .5)
PHP
$x=round($x,0)
Lucky13
July 4th, 2001, 11:35
Awesome....thanks
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.