Merge fmt_human_2 and fmt_human_10 to one function
Now only one function, fmt_human, takes an additional argument "base".
This commit is contained in:
parent
fc0dde5a60
commit
10dbc9543e
7 changed files with 44 additions and 46 deletions
|
@ -29,7 +29,8 @@
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return fmt_human_2((rxbytes - oldrxbytes) * 1000 / interval);
|
||||
return fmt_human((rxbytes - oldrxbytes) * 1000 / interval,
|
||||
1024);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
@ -54,7 +55,8 @@
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return fmt_human_2((txbytes - oldtxbytes) * 1000 / interval);
|
||||
return fmt_human((txbytes - oldtxbytes) * 1000 / interval,
|
||||
1024);
|
||||
}
|
||||
#elif defined(__OpenBSD__)
|
||||
#include <string.h>
|
||||
|
@ -95,7 +97,8 @@
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return fmt_human_2((rxbytes - oldrxbytes) * 1000 / interval);
|
||||
return fmt_human((rxbytes - oldrxbytes) * 1000 / interval,
|
||||
1024);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
@ -130,6 +133,7 @@
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return fmt_human_2((txbytes - oldtxbytes) * 1000 / interval);
|
||||
return fmt_human_2((txbytes - oldtxbytes) * 1000 / interval,
|
||||
1024);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue