Create fuel_calc.py

fixing ValueError: Invalid format specifier

fixes Jxck-S/plane-notify#67
This commit is contained in:
Mark Bumiller 2022-08-07 20:34:10 -04:00 committed by GitHub
parent 1f99e82f5f
commit d4c572c444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ def fuel_message(fuel_info):
cost = "{:,}".format(fuel_info['fuel_price'])
gallons = "{:,}".format(fuel_info['fuel_used_gal'])
lters = "{:,}".format(fuel_info['fuel_used_lters'])
lbs = "{:, }".format(fuel_info['fuel_used_lbs'])
lbs = "{:,}".format(fuel_info['fuel_used_lbs'])
kgs = "{:,}".format(fuel_info['fuel_used_kg'])
fuel_message = f"\n~ {gallons} gallons ({lters} liters). \n~ {lbs} lbs ({kgs} kg) of jet fuel used. \n~ ${cost} cost of fuel. \n~ {fuel_info['c02_tons']} tons of CO2 emissions."
print(fuel_message)