def HumanizeDecimal(number, precision=1, suffix=None):
    """
    Convert a number into the appropriate pretty k, M, G, etc.

    Args:
        totalBytes: the number to convert
        precision:  how many decimal numbers of precision to preserve
        suffix:     use this suffix (k, M, etc.) instead of automatically determining it

    Returns:
        The prettified string version of the input
    """
    if (number == None):
        return "0"

    if (abs(number) < 1000):
        return str(number)

    converted = float(number)
    suffix_index = 0
    suffix_list = [' ', 'k', 'M', 'G', 'T']

    while (abs(converted) >= 1000):
        converted /= 1000.0
        suffix_index += 1
        if suffix_list[suffix_index] == suffix: break

    return "{:.{}f {}}".format(converted, precision, suffix_list[suffix_index])