Skip to content

Commit

Permalink
updates lsdev to show binary size units for capacity instead of decim…
Browse files Browse the repository at this point in the history
…al (ie, TiB instead of TB)
  • Loading branch information
JordanKeo45 committed Feb 5, 2025
1 parent 4bd0609 commit 6fc2377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lsdev
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def print_bays_front(server, options, osd, server_info):
def format_bytes(size_bytes):
if size_bytes == 0 or isinstance(size_bytes,str):
return "0 B"
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
size_name = ("B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB")
i = int(math.floor(math.log(size_bytes, 1024)))
p = math.pow(1024, i)
s = round(size_bytes / p, 2)
Expand Down

0 comments on commit 6fc2377

Please sign in to comment.