3 ms·
The author apparently went back to using a loop after recognizing that it's not readable: https://programming.guide/java/formatting-byte-size-to-human-readable-
by emerongi 3y ago
The author apparently went back to using a loop after recognizing that it's not readable: https://programming.guide/java/formatting-byte-size-to-human-readable-format.html https://programming.guide/java/formatting-byte-size-to-human...
Notably, it's still slightly better than the first code example in the original article, as it takes the rounding bug into account.