Mega Code Archive
Categories
/
Flash ActionScript
/
Development
Use the identical math to round a number to the nearest multiple of an integer
package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ trace (Math.round(92.5 / 5) * 5); // Displays: 95 } } }