Commits

Eric Roshan Eisner committed f15ea0e Draft

binary prefix: standardized capitalization

  • Participants
  • Parent commits 88f79c3

Comments (0)

Files changed (2)

 
 func init() {
 	prefixExp = map[string]int{
-		"K":      3,
 		"u":      -6,
 		"\u00b5": -6,
 	}
 	if s[i-1] == 'i' && v.units == Byte {
 		binary = true
 		i--
+		if i > 0 && s[i-1] == 'K' {
+			// It's KiB and kB.
+			s = "k"
+		}
 	}
 
 	prefix := s[:i]
 	{"kB", "1kB", true},
 	{"KiB", "1.024kB", true},
 	{"Kib", "128B", true},
+	{"KB", "0", false},
+	{"iB", "0", false},
 	{"nib", "0", false},
 
 	{"m//s", "0", false},