Permalink
Browse files

Add terabyte and petabyte support

  • Loading branch information...
1 parent d19de01 commit c1d8fd71b3fe4fdf04ce88a3442aa23048fc846a @dvdplm committed Jan 2, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/redis.c
View
@@ -1890,7 +1890,14 @@ void bytesToHuman(char *s, unsigned long long n) {
} else if (n < (1024LL*1024*1024*1024)) {
d = (double)n/(1024LL*1024*1024);
sprintf(s,"%.2fG",d);
+ } else if (n < (1024LL*1024*1024*1024*1024)) {
+ d = (double)n/(1024LL*1024*1024*1024);
+ sprintf(s,"%.2fT",d);
+ } else if (n < (1024LL*1024*1024*1024*1024*1024)) {
+ d = (double)n/(1024LL*1024*1024*1024*1024);
+ sprintf(s,"%.2fP",d);
} else {
+ /* Let's hope we never need this */
sprintf(s,"%lluB",n);
}
}

0 comments on commit c1d8fd7

Please sign in to comment.