<%#String.Format("{0:c}", Eval("Subtotal"))%>
I am doing that but if the language is Spanish, this is being displayed 475,00 €
The client wants it so that it is actually $ 475.00
possible?
<%#String.Format("{0:c}", Eval("Subtotal"))%>
I am doing that but if the language is Spanish, this is being displayed 475,00 €
The client wants it so that it is actually $ 475.00
possible?
You will need to create a CultureInfo that uses "$" as the currency symbol, then pass it as the first parameter to String.Format.
The string is formatted according to the CurrentUICulture. You can specify the culture explicitly by passing a CultureInfo to Format
, for example US English:
<%#String.Format(CultureInfo.GetCultureInfo("en-US"), "{0:c}", Eval("Subtotal"))%>
To set the culture globally so you don't have to specify it each time, you can change the CurrentUICulture:
Thread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US")