-2

I am trying to convert Numbers into Indian Currency format.

 public static string ConvertStringToRupee(string Amount)
    {
        float num = float.Parse(Amount);
        NumberFormatInfo provider = new NumberFormatInfo
        {
            CurrencyGroupSeparator = ",",
            CurrencyGroupSizes = new int[] { 3, 2 },
            CurrencySymbol = ""
        };
        return num.ToString("N", provider);
    }

It's perfect for 5 digit. If it is exceeding, it takes three digit. For example it shows 3,345,507.00 instead of 33,45,507.00. But I need 33,45,507.00.

Hisanth
  • 62
  • 2
  • 9
  • 1
    duplicate of http://stackoverflow.com/questions/12492567/how-do-i-convert-string-to-indian-money-format – Vinoth Dec 05 '16 at 05:02

1 Answers1

0

To print indian currecy symbol use the below code

string fare = "1234567"; decimal parsed = decimal.Parse(fare, CultureInfo.InvariantCulture); CultureInfo hindi = new CultureInfo("hi-IN"); string text = string.Format(hindi, "{0:c}", parsed);

Siby Sunny
  • 714
  • 6
  • 14