fun toHumanReadableSize()

in src/main/kotlin/com/github/mkartashev/hserr/miner/artifact/Artifact.kt [88:95]


        fun toHumanReadableSize(l: ULong): String {
            return when {
                l >= KiB * KiB * KiB -> String.format("%.2f GiB", l.toDouble().div((KiB * KiB * KiB).toDouble()))
                l >= KiB * KiB -> String.format("%.2f MiB", l.toDouble().div((KiB * KiB).toDouble()))
                l >= KiB -> String.format("%.2f KiB", l.toDouble().div((KiB).toDouble()))
                else -> l.toString() + "B"
            }
        }