Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting an Integer using ISO-prefixes for kB,MB,GB,... and kiB,MiB,GiB,

I looking for the function that prints file size on the mode-line in size-indication-mode. I have searched for size-indication-mode in the source but cannot find a code-references to it. So where is the function that prints for example 22k

when file is approximately 22 kilobytes big?

What about difference between - kilobytes (kB), 1000 bytes, and - kibibytes (KiB), 1024 bytes, as defined at

Shouldn't Emacs support both?

This is of course not that hard to write but why reinvent the wheel?

http://en.wikipedia.org/wiki/Kibibyte

like image 444
Nordlöw Avatar asked Aug 31 '25 20:08

Nordlöw


1 Answers

I noticed that emacs dev (bzr) just go a new function, file-size-human-readable() defined. It does just what I asked for.

Some emacs developer must have heard my call :)

like image 83
Nordlöw Avatar answered Sep 04 '25 04:09

Nordlöw