PCD8544 multiscreen

stringman.h

Committer:
Wimpie
Date:
2012-06-15
Revision:
0:61dcd2c0299a

File content as of revision 0:61dcd2c0299a:

void itostr(char* buffer, int v) {
   char temp[3];
  
   //temp="";
   
    if (v>99999) {

        snprintf(buffer,4,"%3i",v);
    } else

        if (v>9999) {
            snprintf(buffer,4,"%3i",v);
             snprintf(temp,2,"k");
             buffer[3] = temp[1];
            
        } else

            if (v>999) {
                
                snprintf(buffer,4,"%3i",v);
                buffer[3] = buffer[2];
                snprintf(temp,2,"k");
                buffer[2] = temp[1];
            } else
                if (v>99) {
                    snprintf(buffer,4,"%3i",v);

                } else
                    if (v>9) {
                        snprintf(buffer,4,"%3i",v);

                    } else {
                        snprintf(buffer,4,"%3i",v);

                    }

}