Created
July 18, 2015 08:57
-
-
Save dahu/867412256afee141b328 to your computer and use it in GitHub Desktop.
Newlisp (human bytes) function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (human b , (radix 0)) | |
(while (> (/ b 1024) 0) | |
(set 'b (div b 1024)) | |
(inc radix)) | |
(format "%.2f %s" b (nth radix magnitudes))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment