Please guys i need help :( - 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: Please guys i need help :( (
/showthread.php?tid=653264)
Please guys i need help :( -
Castiel17 - 29.04.2018
hey guys i make cmd but i don't know how to make it good like this
i do that : Your balance is $700000000
but i want like this : Your balance is $700.000.000
Re: Please guys i need help :( -
ISmokezU - 29.04.2018
http://forum.sa-mp.com/showpost.php?...postcount=1078
Could just change , to .
Re: Please guys i need help :( -
kovac - 30.04.2018
PHP код:
FormatNumber(number)
{
new numOfPeriods = 0, tmp = number;
new str[32];
while(tmp > 1000) {
tmp = floatround(tmp / 1000, floatround_floor), ++numOfPeriods;
}
valstr(str, number);
new slen = strlen(str);
for(new i = 1; i != numOfPeriods + 1; ++i) {
strins(str, ".", slen - 3*i);
}
return str;
}
This converts your number into a string, so use %s not %d
Re: Please guys i need help :( -
Castiel17 - 30.04.2018
Quote:
Originally Posted by kovac
PHP код:
FormatNumber(number)
{
new numOfPeriods = 0, tmp = number;
new str[32];
while(tmp > 1000) {
tmp = floatround(tmp / 1000, floatround_floor), ++numOfPeriods;
}
valstr(str, number);
new slen = strlen(str);
for(new i = 1; i != numOfPeriods + 1; ++i) {
strins(str, ".", slen - 3*i);
}
return str;
}
This converts your number into a string, so use %s not %d
|
Quote:
Originally Posted by ISmokezU
|
Thanks guys <3 +rep