mile_yard_to_mileage¶
- pyrcs.converter.mile_yard_to_mileage(mile, yard, as_numeric=True)[source]¶
Converts mile and yard to mileage.
- Parameters:
mile (float | int) – The mile data.
yard (float | int) – The yard data.
as_numeric (bool) – Whether to return a numeric value; defaults to
True
.
- Returns:
The corresponding mileage data in the form of <miles>.<yards>.
- Return type:
str | float
Examples:
>>> from pyrcs.converter import mile_yard_to_mileage >>> m, y = 10, 1500 >>> mileage_data = mile_yard_to_mileage(mile=m, yard=y) >>> mileage_data 10.15 >>> mileage_data = mile_yard_to_mileage(mile=m, yard=y, as_numeric=False) >>> mileage_data '10.1500' >>> m, y = 10, 500 >>> mileage_data = mile_yard_to_mileage(mile=m, yard=y, as_numeric=False) >>> mileage_data '10.0500'