开发者

Expressing number in exponential format

开发者 https://www.devze.com 2023-02-25 03:12 出处:网络
We are work开发者_开发知识库ing on a flex project I need to display a number coming from a calculation in exponential format- essentially, show 80900 as 8.09* 10^4; 4.1e-4 as 4.1*10^-4 etc

We are work开发者_开发知识库ing on a flex project

I need to display a number coming from a calculation in exponential format- essentially, show 80900 as 8.09* 10^4; 4.1e-4 as 4.1*10^-4 etc

Any simple way by which I can take the number and separate the exponent and the significand- without getting into string operations.


Try to look into Number.toExponential() method described here.


See if this helps:

"Let's create a custom formatter to change a regular number format to an exponential notation or a fixed-point notation with two fractional digits"

0

精彩评论

暂无评论...
验证码 换一张
取 消