查看模型格式十进制?删除小数点后的值
View model format decimal ? remove value after decimal
我正在使用下面的属性来格式化数字(在值中附加逗号)。现在我想删除小数点后的零。我如何通过以下 属性.
实现相同的效果
[DisplayFormat(DataFormatString = "{0:N}")]
public decimal? Y01Amount { get; set; }
感谢任何帮助。
[DisplayFormat(DataFormatString = "{0:0.##}")]
[DisplayFormat(DataFormatString = "{0:n0}")]
使用上述属性,这两种情况都可以在单个 DisplayFormat 中实现
我正在使用下面的属性来格式化数字(在值中附加逗号)。现在我想删除小数点后的零。我如何通过以下 属性.
实现相同的效果 [DisplayFormat(DataFormatString = "{0:N}")]
public decimal? Y01Amount { get; set; }
感谢任何帮助。
[DisplayFormat(DataFormatString = "{0:0.##}")]
[DisplayFormat(DataFormatString = "{0:n0}")]
使用上述属性,这两种情况都可以在单个 DisplayFormat 中实现