ASP.NET MVC data annotation for currency format

后端 未结 5 1833
栀梦
栀梦 2020-12-10 10:49

I have following POCO with Cost as float.

public class CostChart
{
    public string itemType { get; set; }
    public float? Cost{ get; set; }

}

5条回答
  •  旧巷少年郎
    2020-12-10 11:22

    Check out this article(Codeculous.) an alternate way to validate and display the respective currency symbols without setting Globalization and just by adding the data annotations DataType(DataType.Currency).

提交回复
热议问题