SA-MP Forums Archive
How to convert real number to value (5000 to $ 5,000)? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to convert real number to value (5000 to $ 5,000)? (/showthread.php?tid=609424)



How to convert real number to value (5000 to $ 5,000)? - MarllonGTA - 12.06.2016

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

I want to show the money the players in $


Re: How to convert real number to value (5000 to $ 5,000)? - SsHady - 12.06.2016

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


Re: How to convert real number to value (5000 to $ 5,000)? - AliDollar - 12.06.2016

Код:
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;
}


Re: How to convert real number to value (5000 to $ 5,000)? - MarllonGTA - 12.06.2016

Tranks!