Money indicator - 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: Money indicator (
/showthread.php?tid=339409)
Money indicator -
Bocky1337 - 03.05.2012
Hello people, I wanted to ask how I do it the monetary indicator in the chat
is no longer displayed. (15300500 $) special way ($ 15,300,500)
My idea would be that one can count the places with the strlen function. But I have no idea of it bzs have the code because it did not work deleted.
ask for help.
mfg,
Bocky.
Re: Money indicator -
Accord - 03.05.2012
You can use in this function:
Код:
stock GetNum(num) // by Deably boy
{
new string[256];
format(string, sizeof(string), "%d", num);
for(new idx = strlen(string) % 3 == 0 ? 1 : strlen(string) % 3; idx < strlen(string); idx += 4)
{
strins(string, ",", idx);
}
return string;
}
AW: Money indicator -
Bocky1337 - 03.05.2012
Nice thak you.
Re: Money indicator -
Accord - 03.05.2012
no problem, have a nice day.
-
Bocky1337 - 03.05.2012
There still seems to be an error in it, see Screen
http://s1.directupload.net/file/d/2879/noiiry5p_png.htm
Help please. this Code ist Buggy.
Money is 123
Show is 1.23
Right is that 123
or
Money is 123579
Show is 1.235.79
Right is that 123.579
that ist Buggy...