Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(parseFileSize): Added parseFileSize function to parse a human readable file size to number of bytes #769

Merged
merged 1 commit into from Sep 22, 2023

Commits on Sep 21, 2023

  1. feat(parseFileSize): Added parseFileSize function to parse a human …

    …readable file size to number of bytes
    
    The function is migrated from Nextcloud core. It will parse a human readable file size,
    like `2 KiB` or `2 KB` to machine usable number of bytes.
    e.g. `2 KiB` => 2048 bytes, `2 KB` => 2000 bytes.
    It also allows to force reading the number as binary prefix,
    meaning `2 KB` will be interpreted as 2048 bytes like on some systems were the incorrect unit is used.
    
    Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
    susnux committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    e41200b View commit details
    Browse the repository at this point in the history