From 81e17e770031251e783ceafbcfb4605bae0e6272 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Wed, 4 Aug 2021 17:56:01 +0200 Subject: [PATCH] use culture number format --- Journal/Credits.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Journal/Credits.cs b/Journal/Credits.cs index 946d8f3..7b8f7ed 100644 --- a/Journal/Credits.cs +++ b/Journal/Credits.cs @@ -1,21 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Globalization; namespace NonaBGS.Journal { public class Credits { public static string FormatCredits(int amount) { + var format = CultureInfo.CurrentCulture.NumberFormat; if ((amount % 1000000) == 0) { amount /= 1000000; - return string.Format("{0}M CR", amount); + return string.Format("{0}M CR", amount.ToString(format)); } else if ((amount % 1000) == 0) { amount /= 1000; - return string.Format("{0}K CR", amount); + return string.Format("{0}K CR", amount.ToString(format)); } - return string.Format("{0} CR", amount); + return string.Format("{0} CR", amount.ToString(format)); } } }