def to_float(s: str) -> Optional[float]:
    """
    Convert a string to a float, or return ``None``.

    Before converting:

    - strips out commas (as thousands separator); this is not internationalized
      well!
    - replace Unicode minus and en dash with a hyphen (minus sign)
    """
    if s:
        s = s.replace(',', '')  # comma as thousands separator
        s = s.replace('−', '-')  # Unicode minus
        s = s.replace('–', '-')  # en dash
    try:
        return float(s)
    except (TypeError, ValueError):
        return None