在Azure中货币设置 [英] Currency settings in Azure

查看:147
本文介绍了在Azure中货币设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示工资细节为员工小ASP.NET MVC的网站。

I have a small ASP.NET MVC site that displays salary details for employees.

<td align="right">@String.Format("{0:c}", Model.Salary)</td>

在我的本地机器这显示细如£66,000然而,当上传到Azure它与美元例如显示$ 66,000名。

On my local machine this displays fine e.g. £66,000, however when uploaded to Azure it is displaying with a dollar e.g. $66,000.

当设置我选择西欧作为我的位置,但我显然需要做些别的事情tfor这£按s显示。任何想法?

When setting up I chose western Europe as my location but I obviously need to do something else tfor this to display in £s. Any ideas?

推荐答案

这问题不涉及到Windows Azure,但它只是归结为本地化(你的计算机上的默认文化可能是不同的,从一个在Windows Azure中)。尝试改变文化为en-GB:

This issue is not related to Windows Azure but it simply comes down to localization (the default culture on your machine is probably different from the one in Windows Azure). Try changing the culture to en-GB:

public ActionResult DoSomething()
{
    System.Threading.Thread.CurrentThread.CurrentCulture
        = new System.Globalization.CultureInfo("en-GB");
    System.Threading.Thread.CurrentThread.CurrentUICulture
         = new System.Globalization.CultureInfo("en-GB");

    ...
    model.Salary = 66.000;
    return View(model)
}

这篇关于在Azure中货币设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆