SA-MP Forums Archive
[HELP]Numbers - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Numbers (/showthread.php?tid=72999)



[HELP]Numbers - Khelif - 12.04.2009

I want there to be dot in every number: 12400 => 12.400, 53000 => 53.000.
for example: Congratulations! You have just won $14.560!

Код:
format(str, 64, "Congratulations! You have just won $%d!", Winnings[playerid]);
SendClientMessage(playerid, COLOR_WHITE, str);
which sign should be replaced with '%d'? or what I need to do to make so? please help




Re: [HELP]Numbers - Khelif - 12.04.2009

hey ppl please reply


Re: [HELP]Numbers - 90NINE - 12.04.2009

float(number / 1000.0)
then use %.3f in your string.
Ex: format(str, 64, "Congratulations! You have just won $%.3f!", float(Winnings[playerid] / 1000.0));
It will show the way you want it to as long as the number is above 10,000 and below 100,000.


Re: [HELP]Numbers - Khelif - 12.04.2009

hay thanks very much mate


Re: [HELP]Numbers - Khelif - 13.04.2009

Quote:
Originally Posted by 90NINE
float(number / 1000.0)
then use %.3f in your string.
Ex: format(str, 64, "Congratulations! You have just won $%.3f!", float(Winnings[playerid] / 1000.0));
It will show the way you want it to as long as the number is above 10,000 and below 100,000.
how to make $1000000 => $1.000.000?