Skip to content

Commit

Permalink
fixed a bug in nr_mileage_num_to_str() of utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeqfu committed Jul 22, 2020
1 parent a7b0ef0 commit dbf794d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyrcs/utils.py
Expand Up @@ -174,7 +174,11 @@ def nr_mileage_num_to_str(num_mileage):
nr_mileage_num_to_str(num_mileage) # ''
"""

nr_mileage = '%.4f' % round(float(num_mileage), 4) if num_mileage and pd.notna(num_mileage) else ''
if (num_mileage or num_mileage == 0) and pd.notna(num_mileage):
nr_mileage = '%.4f' % round(float(num_mileage), 4)
else:
nr_mileage = ''

return nr_mileage


Expand Down

0 comments on commit dbf794d

Please sign in to comment.