2

I want to convert decimal to comma separated string for INR currency

1.59 => 1.59
11.59 => 11.59
111.59 => 111.59
1111.59 => 1,111.59
11111.59 => 11,111.59
111111.59 => 1,11,111.59
1111111.59 => 11,11,111.59
11111111.59 => 1,11,11,111.59
111111111.59 => 11,11,11,111.59
1111111111.59 => 111,11,11,111.59

How can we achieve this?

Sahil Sharma
  • 3,847
  • 6
  • 48
  • 98

1 Answers1

8

How about

decimal input = 1111111111.59m;
string result = input.ToString("C", new CultureInfo("EN-in"));
  • "C" is used to convert to Currency
  • "EN-in" sets the English-indian culture

example https://dotnetfiddle.net/PL4yT8

fubo
  • 44,811
  • 17
  • 103
  • 137