def number_to_dp(number, dp, default="", en_dash_for_minus=True):
    """Format number to dp decimal places, optionally using a UTF-8 en dash
    for minus signs."""
    if number is None:
        return default
    s = "{:.{precision}f}".format(number, precision=dp)
    if en_dash_for_minus:
        s = s.replace("-", "–")  # hyphen becomes en dash for minus sign
    return s