- const char *postfix[] = { "", "K", "M", "G", "P", "E" };
- const char *byte_postfix[] = { "", "B", "bit" };
- const unsigned int thousand[] = { 1000, 1024 };
- unsigned int modulo, decimals;
- int byte_post_index = 0, post_index, carry = 0;
+ const char *sistr[] = { "", "k", "M", "G", "T", "P", "E" };
+ const char *iecstr[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei" };
+ const char **unitprefix;
+ static const char *const unitstr[] = {
+ [N2S_NONE] = "",
+ [N2S_PERSEC] = "/s",
+ [N2S_BYTE] = "B",
+ [N2S_BIT] = "bit",
+ [N2S_BYTEPERSEC]= "B/s",
+ [N2S_BITPERSEC] = "bit/s"
+ };
+ const unsigned int thousand = pow2 ? 1024 : 1000;
+ unsigned int modulo;
+ int post_index, carry = 0;