def format_file_size(size):
    """
    Formats the file size as string.

    @param      size        numeric value
    @return                 string (something + unit)
    """
    if size >= 2 ** 30:
        size = size / 2 ** 30
        return "%1.2f Gb" % size
    elif size >= 2 ** 20:
        size = size / 2 ** 20
        return "%1.2f Mb" % size
    elif size >= 2 ** 10:
        size = size / 2 ** 10
        return "%1.2f Kb" % size
    else:
        return "%d" % size