Asp.net 如何更改FormatCurrency()?

Asp.net 如何更改FormatCurrency()?,asp.net,Asp.net,我用的是这句话: FormatCurrency(DBReader("Price").ToString, 2, True) 格式化我的货币 我有两个网站,第一个是英语,第二个是阿拉伯语 在英文网站中,价格将以美元为单位,因为本地化设置设置为“en-US” 在阿拉伯语网站中,价格将以ل.ل货币表示,因为本地化设置设置为“ar LB” 问题是如何格式化此代码: FormatCurrency(DBReader("Price").ToString, 2, True) 要在这两个网站中都使用美元货币?在

我用的是这句话:

FormatCurrency(DBReader("Price").ToString, 2, True)
格式化我的货币 我有两个网站,第一个是英语,第二个是阿拉伯语

在英文网站中,价格将以美元为单位,因为本地化设置设置为“en-US”

在阿拉伯语网站中,价格将以ل.ل货币表示,因为本地化设置设置为“ar LB”

问题是如何格式化此代码:

FormatCurrency(DBReader("Price").ToString, 2, True)

要在这两个网站中都使用美元货币?

在您的
FormatCurrency
方法中,使用
NeutralCulture
或en-US culture

查看使用重载toString函数以及格式说明符和区域设置的示例。

我可以将其保存为:FormatCurrency(DBReader(“Price”).toString(“C”,uo Globalization.CultureInfo.CreateSpecificCulture(“da DK”)),2,True),我有一个错误:参数太多,无法将“Public ReadOnly Default Property Chars(index As Integer)作为Char!”!!你能告诉我如何修改代码使其工作吗请在
FormatCurrency
方法中你想做什么?String.Format(“{0:F2}”,DBReader(“Price”))String.Format(“{0:F2}”,DBReader(“Price”))