开发者

ASP.Net: Eval Format for money expressions

开发者 https://www.devze.com 2022-12-11 03:01 出处:网络
how I can format my database-query in a list view with 2 signs after comma? Now: 100 Should be: 100,00 Now: 75,3

how I can format my database-query in a list view with 2 signs after comma?

Now: 100 Should be: 100,00

Now: 75,3 Should be: 75,30

How I get i开发者_Go百科t when I insert the data in the list view with Eval(xxx)?


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

will format the value using the locale-specific currency settings.


this will give you the exact format you are looking for:

<%# Eval("currency", "{0:0,00}") %>

or this will give you the amount in the local currency (based on the webserver's locale).

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

精彩评论

暂无评论...
验证码 换一张
取 消