Groups > Asp .Net > Data Access and ObjectDataSource Control > Money type - how to format money type in databind




Re: Money type - how to format money type in databind

Re: Money type - how to format money type in databind
Thu, 3 Apr 2008 21:06:58 +0000
You can add a format specifier:

              <asp:BoundField DataField="UnitPrice"
DataFormatString="{0:c}" 
                    HeaderText="UnitPrice"
SortExpression="UnitPrice" />
Post Reply
Re: Money type - how to format money type in databind
Thu, 3 Apr 2008 21:21:00 +0000
Thanks a million Steve, U the king :) 

 

<%#DataBinder.Eval(Container.DataItem, "price",
"{0:c}")%>
Post Reply
Money type - how to format money type in databind
Thu, 3 Apr 2008 23:15:10 +0000
I need to format the info retrieved from a column which uses the money type. 
All the retrieved values have 4 trailing 0's ie $100 is like $100.0000.  How do
i stop that.  I bing this data to webgrids and dropdownlists.

 

Regards

Shaun
Post Reply
about | contact