Flash Floating Point Precision

Flash doesn't correct floating point operations, so you end up with crazy stuff like 152.2*100 = 15219.999999999998.

I tried the following formula to get 2 decimal points precision int(152.2*100)/100 but that gave me the wrong result (151.9) so I found this little gem at actionscript-flash-guru.com that was a lifesaver

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