Module rpu.numbers
Functions
def get_percent_of(percentage: Union[int, float], num: Union[int, float]) ‑> float
-
Returns the percentage given, of the number given
Parameters
number1
:Union[
int,
float]
- the first number
number2
:Union[
int,
float]
- the second number
Useage
… get_percent_of(10, 50)
>>> 5.0
… get_percent_of(2.5123, 1000)
>>> 25.123
Returns
float
- the percentage
def get_percentage(num1: Union[int, float], num2: Union[int, float], /) ‑> float
-
Returns the percentage of the smaller number, when it comes to the bigger number
Parameters
number1
:Union[
int,
float]
- the first number
number2
:Union[
int,
float]
- the second number
Useage
… get_percentage(5, 50)
>>> 10.0
… get_percentage(25.123, 1000)
>>> 2.5123
Returns
float
- the percentage