How to separate numbers with a Comma
#1

Hello,
Does anyone know how to make function, like if you reach above 3 digts it will automaticly seperate it with a comma.
Example: If i have 1500, instead of that it will be replaced with: 1,500.

If i wern't clear enough, i can explain it as best as i can.

My Code is:

pawn Код:
new Random = MRandom(100), str[60];
                if(Random > 25)
                {
                    new Random1 = (random(3500 - 1000) + 700);
                    GivePlayerMoney(playerid, Random1);
                    format(str, sizeof(str), "Money: %d", Random1);
                    SendClientMessage(playerid, -1, str);
                    SendClientMessage(playerid, -1, "Above 25");
                }

                if(Random <= 25)
                {
                    SendClientMessage(playerid, -1, "Less 25");
                }
Reply


Messages In This Thread
How to separate numbers with a Comma - by CrazyChoco - 09.07.2013, 17:51
Re: How to separate numbers with a Comma - by Vince - 09.07.2013, 18:00
Re: How to separate numbers with a Comma - by CrazyChoco - 09.07.2013, 18:09
AW: How to separate numbers with a Comma - by roym899 - 09.07.2013, 19:45

Forum Jump:


Users browsing this thread: 1 Guest(s)