PCD8544 multiscreen
Diff: stringman.h
- Revision:
- 0:61dcd2c0299a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stringman.h Fri Jun 15 18:37:00 2012 +0000 @@ -0,0 +1,37 @@ +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); + + } + +} \ No newline at end of file