diff --git a/Helper/ConfigHelper.cs b/Helper/ConfigHelper.cs index c54ef1c..0c1dbf0 100644 --- a/Helper/ConfigHelper.cs +++ b/Helper/ConfigHelper.cs @@ -195,6 +195,7 @@ namespace CarCareTracker.Helper UseUKMPG = bool.Parse(_config[nameof(UserConfig.UseUKMPG)]), UseMarkDownOnSavedNotes = bool.Parse(_config[nameof(UserConfig.UseMarkDownOnSavedNotes)]), UseThreeDecimalGasCost = bool.Parse(_config[nameof(UserConfig.UseThreeDecimalGasCost)]), + UseThreeDecimalGasConsumption = bool.Parse(_config[nameof(UserConfig.UseThreeDecimalGasConsumption)]), EnableAutoReminderRefresh = bool.Parse(_config[nameof(UserConfig.EnableAutoReminderRefresh)]), EnableAutoOdometerInsert = bool.Parse(_config[nameof(UserConfig.EnableAutoOdometerInsert)]), PreferredGasMileageUnit = _config[nameof(UserConfig.PreferredGasMileageUnit)], diff --git a/Models/UserConfig.cs b/Models/UserConfig.cs index 8dfcfab..1598bda 100644 --- a/Models/UserConfig.cs +++ b/Models/UserConfig.cs @@ -13,6 +13,7 @@ public bool HideZero { get; set; } public bool UseUKMPG {get;set;} public bool UseThreeDecimalGasCost { get; set; } + public bool UseThreeDecimalGasConsumption { get; set; } public bool UseMarkDownOnSavedNotes { get; set; } public bool EnableAutoReminderRefresh { get; set; } public bool EnableAutoOdometerInsert { get; set; } diff --git a/Views/Home/_Settings.cshtml b/Views/Home/_Settings.cshtml index b27733b..d0e1670 100644 --- a/Views/Home/_Settings.cshtml +++ b/Views/Home/_Settings.cshtml @@ -49,6 +49,10 @@ +
+ + +
diff --git a/Views/Vehicle/_Gas.cshtml b/Views/Vehicle/_Gas.cshtml index 5cc3173..5fcebf7 100644 --- a/Views/Vehicle/_Gas.cshtml +++ b/Views/Vehicle/_Gas.cshtml @@ -10,7 +10,9 @@ var useUKMPG = userConfig.UseUKMPG; var hideZero = userConfig.HideZero; var useThreeDecimals = userConfig.UseThreeDecimalGasCost; + var useThreeDecimalsConsumption = userConfig.UseThreeDecimalGasConsumption; var gasCostFormat = useThreeDecimals ? "C3" : "C2"; + var gasConsumptionFormat = useThreeDecimalsConsumption ? "F3" : "F2"; var userLanguage = userConfig.UserLanguage; var useKwh = Model.UseKwh; var useHours = Model.UseHours; @@ -192,7 +194,7 @@ @gasRecord.Date @(gasRecord.Mileage == default ? "---" : gasRecord.Mileage.ToString()) @(gasRecord.DeltaMileage == default ? "---" : gasRecord.DeltaMileage) - @gasRecord.Gallons.ToString("F") + @gasRecord.Gallons.ToString(gasConsumptionFormat) @(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F")) @((hideZero && gasRecord.Cost == default) ? "---" : gasRecord.Cost.ToString(gasCostFormat)) @((hideZero && gasRecord.CostPerGallon == default) ? "---" : gasRecord.CostPerGallon.ToString(gasCostFormat)) diff --git a/Views/Vehicle/_GasModal.cshtml b/Views/Vehicle/_GasModal.cshtml index b6c44e5..9fd493c 100644 --- a/Views/Vehicle/_GasModal.cshtml +++ b/Views/Vehicle/_GasModal.cshtml @@ -7,6 +7,8 @@ var useMPG = userConfig.UseMPG; var useUKMPG = userConfig.UseUKMPG; var userLanguage = userConfig.UserLanguage; + var useThreeDecimals = userConfig.UseThreeDecimalGasCost; + var useThreeDecimalsConsumption = userConfig.UseThreeDecimalGasConsumption; var useKwh = Model.UseKwh; var useHours = Model.UseHours; var isNew = Model.GasRecord.Id == 0; @@ -62,7 +64,7 @@ }
- +
@@ -75,7 +77,7 @@ @if (isNew) {
- +
+ }