/ Published in: ActionScript 3
syntax:
roundToNearest(45, YourValueHere);
roundToNearest(45, YourValueHere);
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function roundToNearest(roundTo:Number, value:Number):Number{ return Math.round(value/roundTo)*roundTo; }
URL: http://www.johncblandii.com/index.php/2009/01/as3-rounding-to-nearest-n.html