import math


def pretty_size(size_in_bytes: int) -> str:
    """ Return a size (in bytes) as a prettified string. """

    size_variants = ('B', 'KB', 'MB')
    size_index = int(math.floor(math.log(abs(size_in_bytes), 1024)))
    size = round(abs(size_in_bytes) / math.pow(1024, size_index), 2)

    size_type = size_variants[size_index]

    precision = 2 if size_index > 1 else 0

    return f'{size:.{precision}f}{size_type}'