blob: fa95001b927752c41a99dd41d2cb9a218b71aa73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
char* ulong_to_string(unsigned long value, char* data)
{
unsigned long t = value;
unsigned long c;
char* dptr = data + 10;
for (int i = 0; i <= 10; i++) {
c = t%10;
*dptr = 0x30 + (c&0xF);
t /= 10;
if (t==0)
break;
dptr -= 1;
// Add decimal point to distinguish orders more easily
if (i == 2) {
*dptr = '.';
dptr -= 1;
}
}
return dptr;
}
|