Changeset e535eeb in mainline for kernel/generic/src/lib/str.c
- Timestamp:
- 2010-04-18T12:28:19Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dec16a2
- Parents:
- e1b6742
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/str.c
re1b6742 re535eeb 918 918 } 919 919 920 void order_suffix(const uint64_t val, uint64_t *rv, char *suffix) 921 { 922 if (val > 10000000000000000000ULL) { 923 *rv = val / 1000000000000000000ULL; 924 *suffix = 'Z'; 925 } else if (val > 1000000000000000000ULL) { 926 *rv = val / 1000000000000000ULL; 927 *suffix = 'E'; 928 } else if (val > 1000000000000000ULL) { 929 *rv = val / 1000000000000ULL; 930 *suffix = 'T'; 931 } else if (val > 1000000000000ULL) { 932 *rv = val / 1000000000ULL; 933 *suffix = 'G'; 934 } else if (val > 1000000000ULL) { 935 *rv = val / 1000000ULL; 936 *suffix = 'M'; 937 } else if (val > 1000000ULL) { 938 *rv = val / 1000ULL; 939 *suffix = 'k'; 940 } else { 941 *rv = val; 942 *suffix = ' '; 943 } 944 } 945 920 946 /** @} 921 947 */
Note:
See TracChangeset
for help on using the changeset viewer.