def file_size(size):
    """
        Convert file size in bytes to human-readable format.

        Parameters
        ----------
        size : float
            File size in bytes.

        Returns
        -------
        file_size : str
            File size in a human-readable format.

        Examples
        --------
        >>> file_size(15481.8)
        15.12 KB
    """
    for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
        if abs(size) < 1024.0:
            return '%03.2f %sB' % (size, unit)
        size /= 1024.0
    return '%03.2f YB' % size