Search code examples
apache-flexflex4flex3

Flex code to convert '1.4348907E22' to '14348907000000000000000'


I am trying to convert Double format number '1.4348907E22' to String format '14348907000000000000000'

I didn't found any clue over the internet for it, can somebody help me on this?


Solution

  • You can use mx.formatters.NumberFormatter like this:

    var fmt:NumberFormatter = new NumberFormatter();
    fmt.useThousandsSeparator = false;
    trace(fmt.format('1.4348907E22'));
    

    This outputs 14348907000000000000000 to the console.