Sure you can do the math yourself but why not trust a tool. coreutils include a tool called numfmt which can convert a number to human readable format. Much like when you run df -h. On mac homebrew, the tool is called gnumfmt. Give it a try:
[code]
$ gnumfmt –to=iec-i –suffix=B 4812939778547
4.4TiB
$ echo 9.78Ti | gnumfmt –from=iec-i –to=iec
9.8T
$ echo 123.456Pi | gnumfmt –from=iec-i –to-unit=G
129452999
[/code]