Force decimals with .toFixed()
3 Apr / 09
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
Related posts:






Post a comment