def get_size_string(size):
    """Return string representation of bytes"""

    # byte conversion numbers
    mbyte = 1024 ** 2
    gbyte = 1024 ** 3
    tbyte = 1024 ** 4
    pbyte = 1024 ** 5

    # convert to float
    size = float(size)

    # get string
    if size / pbyte > 1:
        result = '{:.1f} PB'.format(size / pbyte)
    elif size / tbyte > 1:
        result = '{:.1f} TB'.format(size / tbyte)
    elif size / gbyte > 1:
        result = '{:.1f} GB'.format(size / gbyte)
    else:
        result = '{:.1f} MB'.format(size / mbyte)

    return result