MVC 3 全球化 - 澳大利亚货币
我对澳大利亚文化有疑问。我通过代码设置:
string id = "en-AU";
string ret = Request.ServerVariables["HTTP_REFERER"] ?? "/";
string culture = CultureHelper.GetValidCulture(id);
HttpCookie cookie = Request.Cookies["_culture"];
if (cookie != null)
cookie.Value = culture;
else {
cookie = new HttpCookie("_culture");
cookie.HttpOnly = false;
cookie.Value = culture;
cookie.Expires = DateTime.Now.AddYears(1);
}
Response.Cookies.Add(cookie);
然后我想显示澳元价格:
@String.Format("{0:C}", item.Price
但我得到例如$55.00
。为什么 ?
I have problem with austalian culture. I set this by the code:
string id = "en-AU";
string ret = Request.ServerVariables["HTTP_REFERER"] ?? "/";
string culture = CultureHelper.GetValidCulture(id);
HttpCookie cookie = Request.Cookies["_culture"];
if (cookie != null)
cookie.Value = culture;
else {
cookie = new HttpCookie("_culture");
cookie.HttpOnly = false;
cookie.Value = culture;
cookie.Expires = DateTime.Now.AddYears(1);
}
Response.Cookies.Add(cookie);
then I want to display a price in AUD:
@String.Format("{0:C}", item.Price
but I get e.g $55.00
. Why ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的代码中,您实际上并没有在任何地方应用该文化。像这样的东西:
In your code you are not actually applying the culture anywhere. Something like: