@@ -56,7 +56,7 @@ bitmath.getsize()
5656
5757 >> > import bitmath
5858 >> > print (bitmath.getsize(' ./bitmath/__init__.py' , bestprefix = False ))
59- 34159.0 Byte
59+ 34159.0 B
6060
6161 Recall, the default for representation is with the best
6262 human-readable prefix. We can control the prefix system used by
@@ -208,7 +208,7 @@ bitmath.listdir()
208208 >> > print (discovered_files)
209209 [Byte(1337.0 ), Byte(13370.0 )]
210210 >> > print (reduce (lambda x ,y : x+ y, discovered_files))
211- 14707.0 Byte
211+ 14707.0 B
212212 >> > print (reduce (lambda x ,y : x+ y, discovered_files).best_prefix())
213213 14.3623046875 KiB
214214 >> > print (reduce (lambda x ,y : x+ y, discovered_files).best_prefix().format(" {value:.3f } {unit} " ))
@@ -721,9 +721,9 @@ bitmath.format()
721721
722722 None of the following will be pluralized, because that feature is turned off
723723
724- One unit of 'Bit': 1.0 Bit
724+ One unit of 'Bit': 1.0 b
725725
726- 0 of a unit is typically said pluralized in US English: 0.0 Byte
726+ 0 of a unit is typically said pluralized in US English: 0.0 B
727727
728728 several items of a unit will always be pluralized in normal US English
729729 speech: 42.0 kb
@@ -733,9 +733,9 @@ bitmath.format()
733733 Now, we'll use the bitmath.format() context manager
734734 to print the same test string, but with pluralization enabled.
735735
736- One unit of 'Bit': 1.0 Bit
736+ One unit of 'Bit': 1.0 b
737737
738- 0 of a unit is typically said pluralized in US English: 0.0 Bytes
738+ 0 of a unit is typically said pluralized in US English: 0.0 B
739739
740740 several items of a unit will always be pluralized in normal US English
741741 speech: 42.0 kbs
@@ -754,13 +754,13 @@ bitmath.format()
754754
755755 >> > import bitmath
756756 >> > print (" Some instances: %s , %s " % (bitmath.KiB(1 / 3.0 ), bitmath.Bit(512 )))
757- Some instances: 0.333333333333 KiB, 512.0 Bit
757+ Some instances: 0.333333333333 KiB, 512.0 b
758758 >> > with bitmath.format(" {value:e } -{unit} " ):
759759 ... print (" Some instances: %s , %s " % (bitmath.KiB(1 / 3.0 ), bitmath.Bit(512 )))
760760 ...
761- Some instances: 3.333333e-01 - KiB, 5.120000e+02 - Bit
761+ Some instances: 3.333333e-01 - KiB, 5.120000e+02 - b
762762 >> > print (" Some instances: %s , %s " % (bitmath.KiB(1 / 3.0 ), bitmath.Bit(512 )))
763- Some instances: 0.333333333333 KiB, 512.0 Bit
763+ Some instances: 0.333333333333 KiB, 512.0 b
764764
765765
766766 .. versionadded :: 1.0.8
@@ -805,7 +805,7 @@ behavior.
805805
806806 >> > from bitmath import *
807807 >> > print (MiB(1337 ), kb(0.1234567 ), Byte(0 ))
808- 1337.0 MiB 0.1234567 kb 0.0 Byte
808+ 1337.0 MiB 0.1234567 kb 0.0 B
809809
810810 We can make these instances print however we want to. Let's wrap
811811 each one in square brackets (``[ ``, ``] ``), replace the separating
0 commit comments