Files
picard/test/data/b2h_test_C.dat
Laurent Monin 6de59d8ee9 Add functions to convert bytes to human readable form.
Binary and decimal modes are supported (MB and MiB ie.)
It supports i18n using gettext and locale.
Precision can be modified if needed, by default it is using 1 digit (if needed).

Extensive tests were written, the toughest was to make them work for
both default C locale and fr_FR.UTF-8 locale (ofc it is possible to test for more
locales...). If one locale isn't available on testing system, test is skipped.
fr locale was chosen because decimal point is replaced by a comma and byte units
becomes "octet" units (1.5 MB in english -> 1,5 Mo in french).
2013-06-09 14:23:23 +02:00

75 lines
2.7 KiB
Plaintext

0;0 B;0 B;0 B
1;1 B;1 B;1 B
100;100 B;100 B;100 B
102;102 B;102 B;102 B
500;500 B;500 B;500 B
512;512 B;512 B;512 B
990;990 B;990 B;990 B
999;999 B;999 B;999 B
1000;1 kB;1000 B;1000 B
1013;1 kB;1013 B;1013 B
1023;1 kB;1023 B;1023 B
1024;1 kB;1 KiB;1 KiB
1500;1.5 kB;1.5 KiB;1.46 KiB
1536;1.5 kB;1.5 KiB;1.50 KiB
100000;100 kB;97.7 KiB;97.66 KiB
104857;104.9 kB;102.4 KiB;102.40 KiB
500000;500 kB;488.3 KiB;488.28 KiB
524288;524.3 kB;512 KiB;512 KiB
990000;990 kB;966.8 KiB;966.80 KiB
999900;999.9 kB;976.5 KiB;976.46 KiB
1000000;1 MB;976.6 KiB;976.56 KiB
1038090;1 MB;1013.8 KiB;1013.76 KiB
1048471;1 MB;1023.9 KiB;1023.90 KiB
1048576;1 MB;1 MiB;1 MiB
1500000;1.5 MB;1.4 MiB;1.43 MiB
1572864;1.6 MB;1.5 MiB;1.50 MiB
100000000;100 MB;95.4 MiB;95.37 MiB
107374182;107.4 MB;102.4 MiB;102.40 MiB
500000000;500 MB;476.8 MiB;476.84 MiB
536870912;536.9 MB;512 MiB;512 MiB
990000000;990 MB;944.1 MiB;944.14 MiB
999900000;999.9 MB;953.6 MiB;953.58 MiB
1000000000;1 GB;953.7 MiB;953.67 MiB
1063004405;1.1 GB;1013.8 MiB;1013.76 MiB
1073634449;1.1 GB;1023.9 MiB;1023.90 MiB
1073741824;1.1 GB;1 GiB;1 GiB
1500000000;1.5 GB;1.4 GiB;1.40 GiB
1610612736;1.6 GB;1.5 GiB;1.50 GiB
100000000000;100 GB;93.1 GiB;93.13 GiB
109951162777;110.0 GB;102.4 GiB;102.40 GiB
500000000000;500 GB;465.7 GiB;465.66 GiB
549755813888;549.8 GB;512 GiB;512 GiB
990000000000;990 GB;922 GiB;922.01 GiB
999900000000;999.9 GB;931.2 GiB;931.23 GiB
1000000000000;1 TB;931.3 GiB;931.32 GiB
1088516511498;1.1 TB;1013.8 GiB;1013.76 GiB
1099401676613;1.1 TB;1023.9 GiB;1023.90 GiB
1099511627776;1.1 TB;1 TiB;1 TiB
1500000000000;1.5 TB;1.4 TiB;1.36 TiB
1649267441664;1.6 TB;1.5 TiB;1.50 TiB
100000000000000;100 TB;90.9 TiB;90.95 TiB
112589990684262;112.6 TB;102.4 TiB;102.40 TiB
500000000000000;500 TB;454.7 TiB;454.75 TiB
562949953421312;562.9 TB;512 TiB;512 TiB
990000000000000;990 TB;900.4 TiB;900.40 TiB
999900000000000;999.9 TB;909.4 TiB;909.40 TiB
1000000000000000;1 PB;909.5 TiB;909.49 TiB
1114640907774197;1.1 PB;1013.8 TiB;1013.76 TiB
1125787316851939;1.1 PB;1023.9 TiB;1023.90 TiB
1125899906842624;1.1 PB;1 PiB;1 PiB
1500000000000000;1.5 PB;1.3 PiB;1.33 PiB
1688849860263936;1.7 PB;1.5 PiB;1.50 PiB
100000000000000000;100 PB;88.8 PiB;88.82 PiB
115292150460684704;115.3 PB;102.4 PiB;102.40 PiB
500000000000000000;500 PB;444.1 PiB;444.09 PiB
576460752303423488;576.5 PB;512 PiB;512 PiB
990000000000000000;990 PB;879.3 PiB;879.30 PiB
999900000000000000;999.9 PB;888.1 PiB;888.09 PiB
1000000000000000000;1000 PB;888.2 PiB;888.18 PiB
1141392289560778496;1141.4 PB;1013.8 PiB;1013.76 PiB
1152806212456386304;1152.8 PB;1023.9 PiB;1023.90 PiB
1152921504606846976;1152.9 PB;1024 PiB;1024 PiB
1500000000000000000;1500 PB;1332.3 PiB;1332.27 PiB
1729382256910270464;1729.4 PB;1536 PiB;1536 PiB