15.07.2015, 10:37
Quote:
Hello guys , i have a little question for you :
How can i make a Integer who is > 1000 to appear me 1,000 or if it's 1232344 for example it appear 1.232.344 ! sorry for my really bad english , so i left a code down there ... maybe see what i say .. Код HTML:
new String[128]; format(String, sizeof(String), "Hello, you have {008000}$%i{FFFFFF} !", GetPlayerMoney(playerid)); SendClientMessage(playerid, -1, String); Hello, you have $3.496 ! ==> means $3496 Hello, you have $232.127 ! ==> means $232127 Hello, you have $3.232.566 ! ==> means $3232566 Hello, you have $232.232.566 ! ==> means $232232566 Hello, you have $1.032.232.566 ! ==> means $1032232566 I think you understand what i try to explain with my very bad english o.O |
PHP код:
new sAmount[64], sConvert[64], sA[64], sB[64], iMoniez;
iMoniez = GetPlayerMoney(playerid);
format(sAmount, sizeof(sAmount), "%d", iMoniez);
if (iMoniez >= 1000 && iMoniez < 1000000)
{
strmid(sA, sAmount, 0, strlen(sAmount)-3);
strmid(sB, sAmount, strlen(sAmount)-3, strlen(sAmount));
format(sConvert, sizeof(sConvert), "%s.%s", sA, sB);
return 1;
}