I assume that what you want to do is round to to decimal places.
If all you want to do is display the rounded number, you can use the
NumberFormatter class. This can give you a string representation of the number
rounded as you want it, which is fine for display.
If you need to actually round the number and use the rounded value in
subsequent calculations, you can use the following function.
public function round(number:Number, decimals:int):Number
{
return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);
}
--- In [email protected], "markflex2007" <markflex2...@...> wrote:
>
> I have a number 0.3563567,I want to convert it to 0.36,which function can do
> this?I check Math class at
> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Math.html
>
> but I can not get right one.
>
> Thanks for your help
>
> Mark
>