import decimal


def prettyprint(x, baseunit):
    """
    Just a function to round the printed units to nice amounts

    :param x: Input value
    :param baseunit: Units used
    :return: rounded value with correct unit prefix
    """
    prefix = 'yzafpnµm kMGTPEZY'
    shift = decimal.Decimal('1E24')
    d = (decimal.Decimal(str(x)) * shift).normalize()
    m, e = d.to_eng_string().split('E')
    m = "{0:.2f}".format(float(m))
    return m + " " + prefix[int(e) // 3] + baseunit