How to convert real number to value (5000 to $ 5,000)?
#1

Good morning friends, how do I convert a real number to a value?

I want to show the money the players in $
Reply
#2

All the information you need is provided in the following tutorial
Click Me!
Reply
#3

Код:
stock Comma(numbers) //Credit: Gamer931215
{
	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;
}
Example:
CMD:mymoney(playerid, params[])
{
new string[128];
format(string, sizeof(string),"You have $%s", Comma(GetPlayerMoney(playerid))); //its add , in numbers like 5000 to 5,000
SendClientMessage(playerid, -1, string);
return 1;
}
Reply
#4

Tranks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)