Currency format to get ₹ when use String.Format("{0:C}",45) this code.
Can anyone tell why get like this?
Actually, I want $ symbols with the given value.
Currency format to get ₹ when use String.Format("{0:C}",45) this code.
Can anyone tell why get like this?
Actually, I want $ symbols with the given value.
That code uses the default culture for the current thread - which is probably your system's default culture.
You have options of:
CultureInfo.CurrentCulture
)string.Format
call, before the format stringSo for example:
using System;
using System.Globalization;
public class Test
{
static void Main()
{
CultureInfo culture = new CultureInfo("en-US");
var value = string.Format(culture, "{0:C}", 45);
Console.WriteLine(value);
}
}