In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

flash on 2014-7-16

Get Adobe Flash player
by k-lock 16 Jul 2014
    Embed
/**
 * Copyright k-lock ( http://wonderfl.net/user/k-lock )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/j6vl
 */

package {
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
          
          
          var number:Number = 10.98813311;

            trace(setPrecision(number,0)); 

            trace(setPrecision(number,1)); 

            trace(setPrecision(number,2));
            
        }
        private function setPrecision(number:Number, precision:uint):Number {
            precision = Math.pow(10, precision);
            return Math.round(number * precision)/precision;
        }    
    }
}