diff options
author | Christian Cunningham <cc@localhost> | 2022-03-24 09:52:43 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-03-24 09:52:43 -0700 |
commit | 22e4f3def524d787316b40f46e66ec0455d1ed52 (patch) | |
tree | 66ff4a43b6a3102f541d679c7ce13ccd650bffa5 | |
parent | d91b1f275e7a62fa5787df49769238c29c605a91 (diff) |
Seconds delimiter
-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; } |