from typing import List


def scale_prev_up_to_1(prev_vals: List[float], fraction: float):
    """
    Apply a percentage to the previous value, saturating at one or zero
    """
    val = prev_vals[-1] * fraction
    if val > 1:
        return 1
    elif val < 0:
        return 0
    else:
        return val