def format_value_for_munin(value, zero_allowed=False):
    """
    Convert value into a format that will be understood by Munin
    @param value: value to write
    @param boolean zero_allowed: if True, 0 will be reported as 0, otherwise as unknown ('U')
    @return value
    """
    return value if value or (zero_allowed and value == 0) else 'U'