I have missed that AS3 have a built in support for fixed point notations. This means that you can choose the number of decimals you want to output. Great!

var num:Number = 7.31343;
trace(num.toFixed(3)); // 7.313
 
var num:Number = 4;
trace(num.toFixed(2)); // 4.00

Found at livedocs

Post to Twitter

Related posts:

  1. Fix smoothing bug on scaled bitmaps