AddCommas
#1

I have never understand that function and how to use it.. i need to insert it to a format with variable BizInfo[idx][bMoney]
i tried AddCommas(BizInfo[idx][bMoney]);
it returns fake amount of money like 49 instead of 23,456 for example.

format(string, sizeof(string), "You have $%d in your vault.", AddCommas(BizInfo[idx][bMoney]));
PLEASE HELP !
Reply
#2

Normaly, it should be like this, I don't know what's AddCommas in your script, but try to update your format string to this
pawn Код:
format(string, sizeof(string), "You have $%d in your vault.", BizInfo[idx][bMoney]);
Also, be sure that your string can contain many numbers ..
like if your BizMoney = 10000, and your string character is string[1] , all what you will see is You have $1 in your vault;
I mean, your string should be "bigger", take a string of 64; string[64];
Reply
#3

i suppose you should use %s because AddCommas returns a string?
Reply
#4

if it contains commas that means its string not integer, so use %s istead of %d
Reply
#5

He could simply use BizInfo[idx][bMoney] instead of Addcommas ?
Reply
#6

Quote:
Originally Posted by Golimad
Посмотреть сообщение
He could simply use BizInfo[idx][bMoney] instead of Addcommas ?
he wants to add commas between numbers
Reply
#7

Quote:
Originally Posted by kirollos
Посмотреть сообщение
he wants to add commas between numbers
Ah ! I see now what Commas mean :P ! It should be %s instead of %d then !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)