From 583c83643ac3ae8a43af856355db3a9c03ff7c6d Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sat, 6 Jan 2024 10:30:25 -0700 Subject: [PATCH] added dashes when MPG is not available. --- Views/Vehicle/_Gas.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Views/Vehicle/_Gas.cshtml b/Views/Vehicle/_Gas.cshtml index e5e56b5..6bd9366 100644 --- a/Views/Vehicle/_Gas.cshtml +++ b/Views/Vehicle/_Gas.cshtml @@ -65,7 +65,7 @@ @gasRecord.Date @gasRecord.Mileage @gasRecord.Gallons.ToString("F") - @gasRecord.MilesPerGallon.ToString("F") + @(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F")) @gasRecord.Cost.ToString("C") @gasRecord.CostPerGallon.ToString("C")