kaven-basic - v6.0.0
    Preparing search index...

    Function ToFileSize

    • Converts a number of bytes into a human-readable file size string.

      Parameters

      • bytes: number | bigint

        The number of bytes to convert. Can be a number or bigint.

      • baseOn1024: boolean = false

        If true, uses base 1024 (e.g., KiB, MiB). If false, uses base 1000 (e.g., kB, MB). Defaults to false.

      Returns string

      A string representing the file size in a human-readable format (e.g., "1.23 MB", "456.00 Bytes").

      3.0.0

      2023-03-28