Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 23, 2012 03:33 PM by vinikatyal
Star
13599 Points
2691 Posts
Dec 10, 2012 04:00 AM|LINK
Hi,
<asp:BoundField DataField="Dry Clean" HeaderText="Dry Clean" SortExpression="Dry Clean" DataFormatString="{0:C}" /> <asp:BoundField DataField="Press Only" HeaderText="Press Only" SortExpression="Press Only" DataFormatString="{0:C}" />
Check the below links for more format settings: http://blog.stevex.net/string-formatting-in-csharp/ http://imak47.wordpress.com/2008/11/04/how-to-show-numbers-in-0-1-2-3-4-decimal-places-in-a-gridview/
All-Star
36200 Points
7374 Posts
Dec 10, 2012 05:33 AM|LINK
Text='<%# (Math.Truncate(Eval("DtaLineAmount") * 10) / 10).tostring("0.0") %>'
Member
22 Points
31 Posts
Dec 23, 2012 03:33 PM|LINK
@Decker Thanks it worked yes i will make sure
sarathi125
Star
13599 Points
2691 Posts
Re: Show Amount upto two decimal places without rounding off in DataGrid
Dec 10, 2012 04:00 AM|LINK
Hi,
<asp:BoundField DataField="Dry Clean" HeaderText="Dry Clean" SortExpression="Dry Clean" DataFormatString="{0:C}" />
<asp:BoundField DataField="Press Only" HeaderText="Press Only" SortExpression="Press Only" DataFormatString="{0:C}" />
Check the below links for more format settings:
http://blog.stevex.net/string-formatting-in-csharp/
http://imak47.wordpress.com/2008/11/04/how-to-show-numbers-in-0-1-2-3-4-decimal-places-in-a-gridview/
Remember to click Mark as Answer on the post that helps to others.
My Blog :MyAspSnippets
oned_gk
All-Star
36200 Points
7374 Posts
Re: Show Amount upto two decimal places without rounding off in DataGrid
Dec 10, 2012 05:33 AM|LINK
Text='<%# (Math.Truncate(Eval("DtaLineAmount") * 10) / 10).tostring("0.0") %>'Suwandi - Non Graduate Programmer
vinikatyal
Member
22 Points
31 Posts
Re: Show Amount upto two decimal places without rounding off in DataGrid
Dec 23, 2012 03:33 PM|LINK
@Decker Thanks it worked yes i will make sure