Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
In My excel application

1.Some cells i am using percentage format

I am using percentage format like "0.0%"
My input is=0.032963958883
My Output is=3.3%

2.Some cells i am using Number Millions Format

I am using Number Millions Format like "_(* [>0]#,###0.0,;_(* ([<0]#,###0.0,);_(* "" - ""??_);_(@_)"

My Input is:1343559.427944000000
My Output is:1,343.6

In the same format I need in my asp web application Grid View Items.
How can format this in grid view columns, kindly help me.
Posted
Updated 9-Dec-13 18:02pm
v2
Comments
What have you tried and where is the problem?

1. Number Millions Format
C#
<asp:boundfield datafield="ABC" headertext="ABC" itemstyle-horizontalalign="Right" dataformatstring="{0:0.00}" />


2. Number Percentage Format
C#
<asp:boundfield datafield="ABC" headertext="ABC" itemstyle-horizontalalign="Right" headerstyle-horizontalalign="Center" headerstyle-verticalalign="Bottom" headerstyle-cssclass="yrs1035" nulldisplaytext="" dataformatstring="{0:P1}"/>
 
Share this answer
 
v2
1. Number Millions Format
C#
<asp:boundfield datafield="ABC" headertext="ABC" itemstyle-horizontalalign="Right" dataformatstring="{0:0.00}" xmlns:asp="#unknown" />


2. Number Percentage Format
C#
<asp:boundfield datafield="ABC" headertext="ABC" itemstyle-horizontalalign="Right" headerstyle-horizontalalign="Center" headerstyle-verticalalign="Bottom" headerstyle-cssclass="yrs1035" nulldisplaytext="" dataformatstring="{0:P1}" xmlns:asp="#unknown" />
 
Share this answer
 

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