Skip to main content

humanbytes

Convert bytes to human-readable form (e.g., KB, MB).

def humanbytes(
s: int
) - > string

Convert bytes to human-readable form (e.g., KB, MB).

Parameters

NameTypeDescription
sintThe total number of bytes to be converted into a human-readable string format.

Returns

TypeDescription
stringA formatted string representing the size with the most appropriate unit suffix (e.g., '1.5MB') for human readability.