From c974a9f3ac5d88053af94b26290dfcf59208fecf Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Sat, 28 Aug 2021 00:56:32 +0200 Subject: [PATCH] fix 0 credit being shown with M suffix --- Credits.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Credits.cs b/Credits.cs index fa69b8f..53790d5 100644 --- a/Credits.cs +++ b/Credits.cs @@ -7,10 +7,10 @@ namespace EDJournal { format.NumberGroupSeparator = ","; format.NumberGroupSizes = new int[1] { 3 }; format.NumberDecimalDigits = 0; - if ((amount % 1000000) == 0) { + if (amount > 0 && (amount % 1000000) == 0) { amount /= 1000000; return string.Format("{0}M CR", amount.ToString("N", format)); - } else if ((amount % 1000) == 0) { + } else if (amount > 0 && (amount % 1000) == 0) { amount /= 1000; return string.Format("{0}K CR", amount.ToString("N", format)); }