New source control repo for Biskilog POS - secure hub to store & manage source code. Streamlines dev process, tracks changes, & improves collaboration. Ensures reliable software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

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;
}
}
}