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.

Recommended Answers

All 4 Replies

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

commented: good +8

Hi There

Pls. try this

Text='<%#  Bind ("price", "$ {0:f2)") %>'>

Mark as fixed if it helps you!!!

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

please mark as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.