Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All
how can format column price
like this
11.675
if it is
11.675000000000000000
like this
5.204
if it
5.088750000000000000
Posted

 
Share this answer
 
XML
<asp:GridView id="grid" Runat="Server" >
<Columns>
        <asp:BoundField HeaderText="Amount" DataField="amt"
         FormatString="{0:c}"/>
</Columns>
</asp:GridView>
 
Share this answer
 
datagridview.row(RowNum).Item(ColumnNum).value=format(Val,"#0.000")
for 11.675

i can't get about
5.088750000000000000, how it become 5.204
 
Share this answer
 
v2
Set the attribute of the grid view column field:

C#
DataFormatString="{0:0.000}"
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900