0

I think this is more of a SQL query but how do I change my Grid Viewso that it displays a currency in the proper format of $ with 2 decimal places only? As it stands it is only like 194.9500 format.

Cheers again.

5
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by serkan sendur
1

If the curreny data is a bound column in the GridView, then use the DataFormatString property to format data.

Votes + Comments
0

I think this is more of a SQL query but how do I change my Grid Viewso that it displays a currency in the proper format of $ with 2 decimal places only? As it stands it is only like 194.9500 format.

Cheers again.

Hi

Use this link

http://4guysfromrolla.com/aspfaqs/ShowFAQ.asp?FAQID=181

or

<asp:BoundField  DataField="Price"   HeaderText="Item Price" ReadOnly="True" DataFormatString="{0:c}" HtmlEncode="False">
                        <HeaderStyle  HorizontalAlign="Center" />
                    </asp:BoundField>

Thanks
Sonali

Edited by mike_2000_17: Fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.