Posted By

liakwee on 01/31/10


Tagged

decimal as3 roundOff


Versions (?)

Rounding off decimal place


 / Published in: ActionScript 3
 

  1. function roundOff ( value : Number, decimalPlaces : int ) : Number {
  2. var k : int = Math.pow ( 10, decimalPlaces );
  3.  
  4. value *= k;
  5. value = Math.round ( value );
  6.  
  7. return value / k;
  8. }

Report this snippet  

You need to login to post a comment.