mardi 24 novembre 2015

e+ is added with string after converting from integer

After converting integer into string , at compile time string add up with e+ like in trace i am getting value 90 and in swf it is showing 9.0e+

public function getPlayerAttack(ourTeam:Boolean=true):String{
        var attackArr:Array=[];
        var num:int;
        var total:int=0;
        var _teamXML:XML;
        if (ourTeam)
            _teamXML=getOurTeamXml();
        else
            _teamXML=getOppTeamXml();

        for each (var playerList:XML in _teamXML.player.(@gp!="0")){

            if (playerList.@name!="TEAM"){
                var attackStat:String=getStat("attack_kills",playerList);
                num = int(attackStat);
                if(num >= 10)
                {
                total += num;
                attackArr.push(num);
                }
        }   
    }
var attackPer:int = getPercent(total,attackArr.length);
        var mytext:String = String(attackPer);
        trace(typeof mytext);
        return  mytext;
    }

Aucun commentaire:

Enregistrer un commentaire