mileage_str_to_num

pyrcs.converter.mileage_str_to_num(mileage)[source]

Converts string-type mileage to its corresponding numerical value.

Parameters:

mileage (str) – The string-type mileage data in the form of <miles>.<yards>.

Returns:

The corresponding numerical-type mileage.

Return type:

float

Examples:

>>> from pyrcs.converter import mileage_str_to_num
>>> mileage_num = mileage_str_to_num(mileage='0.0396')
>>> mileage_num
0.0396
>>> mileage_num = mileage_str_to_num(mileage='')
>>> mileage_num
nan