Failed to find the similar topic in StackOverflow, the question is similar to How to convert byte size into human readable format in java?
How to convert byte size into human-readable format in Java? Like 1024 should become "1 Kb" and 1024*1024 should become "1 Mb".
I am kind of sick of writing this utility method for each project. Are there any static methods in Apache Commons for this?
But for Kotlin, had prepared something based on the accepted answer there and wanted to share it but thought should posting it in a separate thread is better to not distract people on that thread so others also can comment or post other idiomatic Kotlin answers here