AnsweredAssumed Answered

How to convert integer to string?

Question asked by H.Rick on Jan 2, 2014
Latest reply on Jan 7, 2014 by Trevor
struct tm time;
   char year[50];
Guys,

I want to display year into LCD screen but I got 00 on LCD, any clues on how to do it ?
thanks
 printf("Time: %d-%d-%d   %02d:%02d:%02d \r\n", time.tm_year, \
                   time.tm_mon+1, time.tm_mday,\
                   time.tm_hour, time.tm_min, time.tm_sec);
    sprintf(year,"%.2f",time.tm_year);
    lcd_string(year);

Outcomes