String.Format("{0:f2}",value); String.Format("{0: #,#.00",value);
In GridView:
<%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "pricerange").ToString())%>
<EditItemTemplate> <asp:TextBox ID="txtPrice" runat="server" Text='<%# String.Format("{0:#,###}",Bind("Price")) %>' /> </EditItemTemplate> <EditItemTemplate> <%# String.Format("{0:C}", Convert.ToString(Eval("Amount")) ) %> <EditItemTemplate>
More info:
http://msdn.microsoft.com/en-us/library/system.string.format.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.dataformatstring.aspx