from typing import Any


def _get_rounded_value(attr: dict[str, Any], key: str) -> int | float | None:
    """Get rounded value for given key."""
    if (val := attr.get(key)) is None:
        return None
    return round(val, 2)