我從一個基類派生的控制器:更改貨幣符號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對象...
謝謝