Seperate numbers by comma?
#1

Hello, i am trying to seperate the moneys in /stats by commas, i have made this but for some reason it doesnt work, i hope that someone can help me

pawn Код:
new totalwealth;
        totalwealth = PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
pawn Код:
format(string, sizeof(string), "Details: "COL_WHITE"Money:[$%d] Bank:[$%d] Total wealth:[$%d] Job:[%s]",Comma(PlayerInfo[targetid][pCash]),Comma(PlayerInfo[targetid][pAccount]),Comma(totalwealth),jtext);
        SendClientMessage(playerid, COLOR_SZR,string);
pawn Код:
stock Comma(numbers)
{
    new temp[24],counter = -1;
    valstr(temp,numbers);
    for(new i = strlen(temp);i > 0; i--)
    {
        counter++;
        if(counter == 3)
        {
            strins(temp,",",i);
            counter = 0;
        }
    }
    return temp;
}
Reply


Messages In This Thread
Seperate numbers by comma? - by MayaEU - 12.06.2016, 16:33
Re: Seperate numbers by comma? - by Sjn - 12.06.2016, 16:41
Re: Seperate numbers by comma? - by MayaEU - 12.06.2016, 16:44

Forum Jump:


Users browsing this thread: 1 Guest(s)