import os
import json


def size_of_file(file_size):
    units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
    i = 0
    while file_size > 1024.0 and i < len(units) - 1:
        file_size /= 1024.0
        i += 1
    return f'{round(file_size, 2)} {units[i]}'
