diff options
Diffstat (limited to 'usr')
-rw-r--r-- | usr/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -5,7 +5,7 @@ char* ulong_to_string(unsigned long value, char* data) { unsigned long t = value; unsigned long c; - char* dptr = data + 9; + char* dptr = data + 10; for (int i = 0; i <= 10; i++) { c = t%10; *dptr = 0x30 + (c&0xF); @@ -13,6 +13,10 @@ char* ulong_to_string(unsigned long value, char* data) if (t==0) break; dptr -= 1; + if (i == 5) { + *dptr = '.'; + dptr -= 1; + } } return dptr; } |