@@ -48,7 +49,7 @@
@collisionRecord.Date.ToShortDateString() |
@collisionRecord.Mileage |
@collisionRecord.Description |
-
@collisionRecord.Cost.ToString("C") |
+
@((hideZero && collisionRecord.Cost == default) ? "---" : collisionRecord.Cost.ToString("C")) |
@collisionRecord.Notes |
}
diff --git a/Views/Vehicle/_Gas.cshtml b/Views/Vehicle/_Gas.cshtml
index b12294f..a861433 100644
--- a/Views/Vehicle/_Gas.cshtml
+++ b/Views/Vehicle/_Gas.cshtml
@@ -3,6 +3,7 @@
@{
var enableCsvImports = bool.Parse(Configuration[nameof(UserConfig.EnableCsvImports)]);
var useMPG = bool.Parse(Configuration[nameof(UserConfig.UseMPG)]);
+ var hideZero = bool.Parse(Configuration[nameof(UserConfig.HideZero)]);
var useKwh = Model.UseKwh;
string consumptionUnit;
string fuelEconomyUnit;
@@ -66,8 +67,8 @@
@gasRecord.Mileage |
@gasRecord.Gallons.ToString("F") |
@(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F")) |
-
@gasRecord.Cost.ToString("C3") |
-
@gasRecord.CostPerGallon.ToString("C3") |
+
@((hideZero && gasRecord.Cost == default) ? "---" : gasRecord.Cost.ToString("C3")) |
+
@((hideZero && gasRecord.CostPerGallon == default) ? "---" : gasRecord.CostPerGallon.ToString("C3")) |
}
diff --git a/Views/Vehicle/_ServiceRecords.cshtml b/Views/Vehicle/_ServiceRecords.cshtml
index 139ef9d..447648d 100644
--- a/Views/Vehicle/_ServiceRecords.cshtml
+++ b/Views/Vehicle/_ServiceRecords.cshtml
@@ -1,6 +1,7 @@
@inject IConfiguration Configuration
@{
var enableCsvImports = bool.Parse(Configuration[nameof(UserConfig.EnableCsvImports)]);
+ var hideZero = bool.Parse(Configuration[nameof(UserConfig.HideZero)]);
}
@model List
@@ -48,7 +49,7 @@
@serviceRecord.Date.ToShortDateString() |
@serviceRecord.Mileage |
@serviceRecord.Description |
-
@serviceRecord.Cost.ToString("C") |
+
@((hideZero && serviceRecord.Cost == default) ? "---" : serviceRecord.Cost.ToString("C")) |
@serviceRecord.Notes |
}
diff --git a/Views/Vehicle/_TaxRecords.cshtml b/Views/Vehicle/_TaxRecords.cshtml
index 02c6fde..5c795b1 100644
--- a/Views/Vehicle/_TaxRecords.cshtml
+++ b/Views/Vehicle/_TaxRecords.cshtml
@@ -1,6 +1,7 @@
@inject IConfiguration Configuration
@{
var enableCsvImports = bool.Parse(Configuration[nameof(UserConfig.EnableCsvImports)]);
+ var hideZero = bool.Parse(Configuration[nameof(UserConfig.HideZero)]);
}
@model List
@@ -46,7 +47,7 @@
| @taxRecord.Date.ToShortDateString() |
@taxRecord.Description |
- @taxRecord.Cost.ToString("C") |
+ @((hideZero && taxRecord.Cost == default) ? "---" : taxRecord.Cost.ToString("C")) |
@taxRecord.Notes |
}
diff --git a/appsettings.json b/appsettings.json
index 6252e11..bf22a5e 100644
--- a/appsettings.json
+++ b/appsettings.json
@@ -11,6 +11,7 @@
"UseMPG": true,
"UseDescending": false,
"EnableAuth": false,
+ "HideZero": false,
"UserNameHash": "",
"UserPasswordHash": ""
}