shift_mileage_by_yard¶
- pyrcs.converter.shift_mileage_by_yard(mileage, shift_yards, as_numeric=True)[source]¶
Shifts the given mileage by a specified number of yards.
- Parameters:
mileage (float | int | str) – The initial mileage (associated with an ELR).
shift_yards (int | float) – The number of yards by which to shift the given mileage.
as_numeric (bool) – If
True
, returns the result as a numeric type; defaults toTrue
.
- Returns:
The mileage shifted by the specified number of yards.
- Return type:
float | str
Examples:
>>> from pyrcs.converter import shift_mileage_by_yard >>> n_mileage = shift_mileage_by_yard(mileage='0.0396', shift_yards=220) >>> n_mileage 0.0616 >>> n_mileage = shift_mileage_by_yard(mileage='0.0396', shift_yards=221) >>> n_mileage 0.0617 >>> n_mileage = shift_mileage_by_yard(mileage=10, shift_yards=220) >>> n_mileage 10.022