-/*
- * Method to convert numbers into pretty numbers that easy
- * to read. The design here is to add comma after each three
- * digits and set all of this inside buffer.
- *
- * For example if n = 1799321, the output will be
- * 1,799,321 after this method which is easier to read.
- */
-static char *
-pretty_number(uint64_t n, char *buf)
-{
- char p[6][4];
- int i = 0;
- int off = 0;
-
- while (n > 1000) {
- sprintf(p[i], "%03d", (int)(n % 1000));
- n /= 1000;
- i += 1;
- }
-
- sprintf(p[i++], "%d", (int)n);
-
- while (i--)
- off += sprintf(buf + off, "%s,", p[i]);
- buf[strlen(buf) - 1] = '\0';
-
- return buf;
-}
-