Wednesday, December 3, 2014

Display Flexible Decimal Places

Display Flexible Decimal Places, e.g. 22.1000 will display as 22.1
.ToString("#,0.####")

Gridview > Text='<%# Eval("Price", "{0:#,0.####}")%>'

<asp:BoundField DataField="Price" HeaderText="Price" DataFormatString="{0:#,0.####}" />
<asp:BoundField DataField="EDate" DataFormatString="{0:dd-MM-yyyy}" HeaderText=" Date" />
<asp:BoundField DataField="EDate" DataFormatString="{0:HH:mm}" HeaderText="Time" />

No comments:

Post a Comment