I want to show pound sign and the format 0.00 i.e £45.00, £4.10 . I am using the following statement:
<%# Convert.To
-
I wanted to add an additional related answer to show how to use a cloned CultureInfo object in a string.Format() or StringBuffer.AppendFormat(). Instead of currency though, my need was to format the AM/PM designator for my employer's style guide. Here is what I did:
var culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
culture.DateTimeFormat.AMDesignator = "a.m.";
culture.DateTimeFormat.PMDesignator = "p.m.";
....
var msg = new StringBuilder();
msg.AppendFormat(culture,"Last modified: {0:M/d/yyyy h:mm tt}", ad.DateModified);
You can do the same thing with string.Format():
string strMsg = string.Format(culture, "Last modified: {0:M/d/yyyy h:mm tt}", ad.DateModified);
- 热议问题