@@ -73,50 +73,65 @@ defmodule RabbitMQ.CLI.InformationUnit do
73
73
defp do_convert ( bytes , "kb" ) do
74
74
Float . round ( bytes / @ kilobyte_bytes , 4 )
75
75
end
76
+
76
77
defp do_convert ( bytes , "k" ) , do: do_convert ( bytes , "kb" )
78
+
77
79
defp do_convert ( bytes , "ki" ) do
78
80
Float . round ( bytes / @ kibibyte_bytes , 4 )
79
81
end
82
+
80
83
defp do_convert ( bytes , "kib" ) , do: do_convert ( bytes , "ki" )
81
84
defp do_convert ( bytes , "kilobytes" ) , do: do_convert ( bytes , "kb" )
82
85
83
86
defp do_convert ( bytes , "mb" ) do
84
87
Float . round ( bytes / @ megabyte_bytes , 4 )
85
88
end
89
+
86
90
defp do_convert ( bytes , "m" ) , do: do_convert ( bytes , "mb" )
91
+
87
92
defp do_convert ( bytes , "mi" ) do
88
93
Float . round ( bytes / @ mebibyte_bytes , 4 )
89
94
end
95
+
90
96
defp do_convert ( bytes , "mib" ) , do: do_convert ( bytes , "mi" )
91
97
defp do_convert ( bytes , "megabytes" ) , do: do_convert ( bytes , "mb" )
92
98
93
99
defp do_convert ( bytes , "gb" ) do
94
100
Float . round ( bytes / @ gigabyte_bytes , 4 )
95
101
end
102
+
96
103
defp do_convert ( bytes , "g" ) , do: do_convert ( bytes , "gb" )
104
+
97
105
defp do_convert ( bytes , "gi" ) do
98
106
Float . round ( bytes / @ gigabyte_bytes , 4 )
99
107
end
108
+
100
109
defp do_convert ( bytes , "gib" ) , do: do_convert ( bytes , "gi" )
101
110
defp do_convert ( bytes , "gigabytes" ) , do: do_convert ( bytes , "gb" )
102
111
103
112
defp do_convert ( bytes , "tb" ) do
104
113
Float . round ( bytes / @ terabyte_bytes , 4 )
105
114
end
115
+
106
116
defp do_convert ( bytes , "t" ) , do: do_convert ( bytes , "tb" )
117
+
107
118
defp do_convert ( bytes , "ti" ) do
108
119
Float . round ( bytes / @ tebibyte_bytes , 4 )
109
120
end
121
+
110
122
defp do_convert ( bytes , "tib" ) , do: do_convert ( bytes , "ti" )
111
123
defp do_convert ( bytes , "terabytes" ) , do: do_convert ( bytes , "tb" )
112
124
113
125
defp do_convert ( bytes , "pb" ) do
114
126
Float . round ( bytes / @ petabyte_bytes , 4 )
115
127
end
128
+
116
129
defp do_convert ( bytes , "p" ) , do: do_convert ( bytes , "pb" )
130
+
117
131
defp do_convert ( bytes , "pi" ) do
118
132
Float . round ( bytes / @ pebibyte_bytes , 4 )
119
133
end
134
+
120
135
defp do_convert ( bytes , "pib" ) , do: do_convert ( bytes , "pi" )
121
136
defp do_convert ( bytes , "petabytes" ) , do: do_convert ( bytes , "pb" )
122
137
end
0 commit comments