def transform_parameter(
        floor: float, ceiling: float, request: float, current: float
) -> float:
    """Return requested if between floor and ceiling, or else return current."""
    if not floor <= current <= ceiling:
        request = min(ceiling, max(floor, request))
    if floor <= request <= ceiling:
        return request

    return current