ASP.Net:货币表达式的评估格式

标签 asp.net

如何在 ListView 中格式化我的数据库查询,逗号后有 2 个符号?

现在:100
应该是:100,00

现在:75,3
应该是:75,30

当我使用 Eval(xxx) 在 ListView 中插入数据时如何获得它?

最佳答案

<%# Eval("myField", "{0:c}") %>

将使用特定于区域设置的货币设置格式化值。

关于ASP.Net:货币表达式的评估格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1680575/

相关文章:

c# - 错误 : String was not recognized as a valid DateTime while converting to date format in c#

asp.net - Crystal Reports 仅在本地显示条形码

c# - 显示在文本框、标签后面的菜单。 ASP.NET/C#

asp.net - 将 System.Web.Security.MachineKey.Encode 替换为 System.Web.Security.MachineKey.Protect

c# - 如何使用 Eval() 函数将数据集结果绑定(bind)到 ASPX 页面

c# - 在 web.config 中包含数据库密码的潜在安全风险是什么

c# - 我想使用 aspx 在网络上旋转图像

asp.net - 在 dotnet mvc 5 中,如何将服务注入(inject) View ?

asp.net - 如何在 ASP.NET MVC 中渲染 HTML 字符串?

c# - ASP 连接错误 : Incorrect syntax near the keyword 'User