Click here to Skip to main content
15,944,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I uploading an excel in my windows application but my question is in one column values are like 1234.8 but I want to show like 1234.80 how can I make this please help me

Here the column in the excel is general format and I loaded it on GridView now my Intention is modify the particular column in GridView so it should display 2 digit after decimal

Thanks & regards
Indrajit dasgupta
Posted
Updated 31-May-13 1:38am
v2
Comments
Osman24 31-May-13 7:29am    
Can you be more specific ?

Is it appropriate :
string s=string.Format("{0:0.00}",doubleValue);
IndrajitDasgupat 31-May-13 7:38am    
Here the column in the excel is general format and I loaded it on GridView now my Intention is modify the particular column in GridView so it should display 2 digit after decimal
ZurdoDev 31-May-13 7:56am    
Format your gridview column.

1 solution

<asp:boundfield datafield="YourColumn" dataformatstring="{0:#.##}" />

I think it is what you need
 
Share this answer
 
v2
Comments
[no name] 31-May-13 9:19am    
How is this going to work for a Windows application as was clearly stated by the OP?
Osman24 31-May-13 9:22am    
Sorry it is my bad but you said GridView yet in Windows Application it is DataGridView :). For it
yourcolumn.DefaultCellStyle.Format = "n2";
yourcolumn.ValueType = GetType(double);

I think it is something like that

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