943,755 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 672
  • ASP.NET RSS
Sep 14th, 2009
0

Data String types

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
f_atencia is offline Offline
52 posts
since Aug 2009
Sep 14th, 2009
1

Re: Data String types

If the curreny data is a bound column in the GridView, then use the DataFormatString property to format data.
Reputation Points: 165
Solved Threads: 113
Posting Pro
Ramesh S is offline Offline
580 posts
since Jun 2009
Sep 14th, 2009
0

Re: Data String types

Hi There

Pls. try this
ASP.NET Syntax (Toggle Plain Text)
  1. Text='<%# Bind ("price", "$ {0:f2)") %>'>

Mark as fixed if it helps you!!!
Reputation Points: 12
Solved Threads: 38
Junior Poster
reach_yousuf is offline Offline
194 posts
since Sep 2007
Sep 14th, 2009
0

Re: Data String types

Click to Expand / Collapse  Quote originally posted by f_atencia ...
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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
sonali.yende is offline Offline
1 posts
since Sep 2009
Sep 14th, 2009
0

Re: Data String types

please mark as solved.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Ignore Return Key press
Next Thread in ASP.NET Forum Timeline: i need help with asp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC