using Biskilog_Accounting.Shared.Interfaces; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Biskilog_Accounting.Shared.ServiceRepo { public class CalculatorService : ICalculator { public double CalculatePercentage() { throw new NotImplementedException(); } public string FormatMoneyWithCurrency(double a_amount) { return string.Format(GetCurrencyCode(), " {0:C2}", a_amount); } public NumberFormatInfo GetCurrencyCode() { //TODO have a better implementation // Specify the locale for Ghana string locale = "en-GH"; // Get the NumberFormatInfo for the specified locale NumberFormatInfo numberFormatInfo = new CultureInfo(locale).NumberFormat; // Set the currency symbol to Ghanaian cedi numberFormatInfo.CurrencySymbol = "GH₵"; return numberFormatInfo; } } }