Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我为税收范围创建了一个表格。现在我想显示格式如下的金额:$100,000. 我怎样才能做到这一点?
$100,000
您可以尝试这种格式,并将金额替换为自定义值。
@string.Format("{0:C}", amount);
您可以在模型中添加它,货币符号将在您引用该字段时显示
[DisplayFormat(DataFormatString = "{0:C}", ApplyFormatInEditMode = true)] public decimal DebitAmount { get; set; }