Posted By

visualadvance on 06/06/11


Tagged


Versions (?)

AS3: Round Decimal


 / Published in: ActionScript 3
 

  1. private function roundDec (numIn:Number, decimalPlaces:int):Number
  2. {
  3. var nExp:int = Math.pow (10, decimalPlaces) ;
  4. var nRetVal:Number = Math.round(numIn * nExp) / nExp
  5. return nRetVal;
  6. }

Report this snippet  

You need to login to post a comment.