0
private var xml:XML = <root><data><name>123456789012345678903333333333</name></data></root>

        public function xmlConversion(xml:XML):void
        {  
            _xmlDoc = new XMLDocument(xml.toString());  
            _decoder = new SimpleXMLDecoder(true);  
            _resultObj = _decoder.decodeXML(_xmlDoc);  
            _arrCol = new ArrayCollection();
            _arrCol.addItem(_resultObj.root.data);
            trace(_arrCol.getItemAt(0).name);

        } 

trace:

1.23456789012345e+29

I want result name's value as:

123456789012345678903333333333
pavan
  • 470
  • 3
  • 11
  • 25
  • I would expect the XML value to be a string unless otherwise specified (or possibly an object). Is your real intent to change the trace output? Or are you worried about the data type of the value? Does this work: trace(String(_arrCol.getItemAt(0).name)); ? – JeffryHouser Mar 18 '13 at 12:23

1 Answers1

0

The SimpleXMLDecoder decodeXML method converts your "big number string" into a Number type. The Number type can hold only 17 (or is it 16?) digits... So it will always be stored as exponential.

What you can do is to use your XML node directly as a String e.g

trace("Your xml node value as string:"+xml.data.name);

this will trace: Your xml node value as string:123456789012345678903333333333

P.S. this should probably be a comment but I doesn't have yet enough rep. to do so

michaPau
  • 1,598
  • 18
  • 24