views:

46

answers:

3

How i can set the format of the string returned by Bind ?

<asp:Label ID="lbl" runat="server" Text='<%# Bind("Money") %>'>

thanks

A: 

Very easy, it's like this:

<%= Bind ("price", "$ {0:f2)") %> for Currency formats

Kovu
A: 

With string.Format:

Text='<%# String.Format("{0:f2}", (double)Bind("Money")) %>'
CRice
that is, if Money is a double...
CRice
+1  A: 

plz check this

http://www.15seconds.com/Issue/040630.htm