Actionscript 3 大数取整为3

Actionscript 3 大数取整为3,actionscript-3,actionscript,rounding,Actionscript 3,Actionscript,Rounding,我有一个巨大的数字,例如1.98726575488820e+30,我想将其四舍五入为以下形式: 地板+“”(不加引号)+五位数尾数+“e+…”(如果有e),但我不知道怎么做。 在这种情况下:1.98727e+30 非常感谢您的帮助。将为您提供如下字符串: var hugeNumber:Number = Number("1.98726575488820e+30"); var rounded:String = hugeNumber.toPrecision(6); trace(rounded); //

我有一个巨大的数字,例如1.98726575488820e+30,我想将其四舍五入为以下形式: 地板+“”(不加引号)+五位数尾数+“e+…”(如果有e),但我不知道怎么做。 在这种情况下:1.98727e+30

非常感谢您的帮助。

将为您提供如下字符串:

var hugeNumber:Number = Number("1.98726575488820e+30");
var rounded:String = hugeNumber.toPrecision(6);
trace(rounded); // "1.98727e+30"