def bytes_to_human_readable(memory_amount):
    """ Utility to convert a number of bytes (int) in a human readable string (with units)
    """
    for unit in ['B', 'KB', 'MB', 'GB']:
        if memory_amount > -1024.0 and memory_amount < 1024.0:
            return '{:.3f}{}'.format(memory_amount, unit)
        memory_amount /= 1024.0
    return '{:.3f}TB'.format(memory_amount)
