Data String types

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2009
Posts: 8
Reputation: f_atencia is an unknown quantity at this point 
Solved Threads: 0
f_atencia f_atencia is offline Offline
Newbie Poster

Data String types

 
0
  #1
Sep 14th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 432
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training

Re: Data String types

 
1
  #2
Sep 14th, 2009
If the curreny data is a bound column in the GridView, then use the DataFormatString property to format data.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 66
Reputation: reach_yousuf is an unknown quantity at this point 
Solved Threads: 12
reach_yousuf reach_yousuf is offline Offline
Junior Poster in Training

Re: Data String types

 
0
  #3
Sep 14th, 2009
Hi There

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

Mark as fixed if it helps you!!!
Yousuf
Software Developer
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 1
Reputation: sonali.yende is an unknown quantity at this point 
Solved Threads: 0
sonali.yende sonali.yende is offline Offline
Newbie Poster

Re: Data String types

 
0
  #4
Sep 14th, 2009
Originally Posted by f_atencia View 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.
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: Data String types

 
0
  #5
Sep 14th, 2009
please mark as solved.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC