diff --git a/Helper/GasHelper.cs b/Helper/GasHelper.cs index 2d12758..c6cd767 100644 --- a/Helper/GasHelper.cs +++ b/Helper/GasHelper.cs @@ -11,12 +11,13 @@ namespace CarCareTracker.Helper { public string GetAverageGasMileage(List results, bool useMPG) { - var recordWithCalculatedMPG = results.Where(x => x.MilesPerGallon > 0); + var recordsToCalculateGallons = results.Where(x => x.MilesPerGallon > 0 || !x.IsFillToFull); + var recordWithCalculatedMPG = recordsToCalculateGallons.Where(x => x.MilesPerGallon > 0); var minMileage = results.Min(x => x.Mileage); if (recordWithCalculatedMPG.Any()) { var maxMileage = recordWithCalculatedMPG.Max(x => x.Mileage); - var totalGallonsConsumed = recordWithCalculatedMPG.Sum(x => x.Gallons); + var totalGallonsConsumed = recordsToCalculateGallons.Sum(x => x.Gallons); var deltaMileage = maxMileage - minMileage; var averageGasMileage = (maxMileage - minMileage) / totalGallonsConsumed; if (!useMPG) diff --git a/Views/Home/_Settings.cshtml b/Views/Home/_Settings.cshtml index 149570b..c8dfea4 100644 --- a/Views/Home/_Settings.cshtml +++ b/Views/Home/_Settings.cshtml @@ -154,7 +154,7 @@
- Version 1.0.8 + Version 1.0.9

Proudly developed in the rural town of Price, Utah by Hargata Softworks.