我从一个基类派生的控制器:更改货币符号thoroughout应用
namespace merawi.Controllers
{
public class BaseController : Controller
{
public CultureInfo trTR = new CultureInfo("tr-TR");
public BaseController()
{
trTR.NumberFormat.CurrencySymbol = "TL";
}
}
}
,并使用此语句货币格式:
ViewBag.SellingPrice = sp.ToString("C", trTR);
然而,在具有的ViewModels的意见像
@model List<merawi.Models.DocumentWorkStep>
我需要一种方式,需要格式化货币。
SellingPrice
在DocumentWorkStep
类小数场:
public Nullable<decimal> SellingPrice { get; set; }
,并使用该
<td>@string.Format("{0:C}", res.SellingPrice)</td>
输出₺,我需要 “TL”
我需要一种方法来访问从视图文件trTR对象...
谢谢