Convert string
#1

Hi,

I have string where is stored data like 2016-8-13, but i want to convert it with 0, that 2016-08-13 would be 0 - 00 - 1 - 01 and so on..
Reply
#2

Use %02i
Reply
#3

Yes, but i have string and i from it get data and convert to 02i
Reply
#4

pawn Код:
new string[12] = "2016-8-13", year, month, day;
sscanf(string, "p<->iii", year, month, day);
   
format(string, sizeof string, "%i-%02i-%02i", year, month, day);
print(string);
// Prints: "2016-08-13"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)