def frequency(total: float, percentage: float, value: float, invert: bool = False) -> float:
    """Return frequency of a given value .

    Freq = v*t/p

    v-> value
    t-> total
    p-> percentage

    Args:
        total (float): total value
        percentage (float): percentage value between 0 and 1
        value (float): value
        invert (bool, optional): change total by percentage in formula. Defaults to False.

    Returns:
        float: frequency result
    """
    return (value * total) / percentage if invert is True else (value * percentage) / total