Click here to Skip to main content
15,899,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to display numeric(9,2) values as integer in repeater...


Eval("Percentage", "{0:P}")
its not working pls help reply...
Posted
Comments
Kiirrii 29-Feb-12 23:49pm    
<%# String.Format("{0:D}", Eval("Percentage")) %>

<![CDATA[<%#Convert.ToInt32(Eval("Percentage"))%>]]> both are not working..

See if something like this won't work for you.
Convert.ToInt(DataBinder.Eval(xxxx))
 
Share this answer
 
Try this
C#
<![CDATA[<%#Convert.ToInt32(Eval("Percentage"))%>]]>
 
Share this answer
 
Comments
Kiirrii 29-Feb-12 23:45pm    
hey actually Percentage is float i mean numeric(9,2) in database so its showing error like string was not in correct format...
Kiirrii 29-Feb-12 23:47pm    
i tried your solution.... have u ever tried this
<%# String.Format("{0:D}", Eval("Percentage")) %>

i want to display 12.00 values to 12 in repeater control... :-)
Anuja Pawar Indore 1-Mar-12 4:14am    
I tried this and is working fine
<asp:Label ID="Label1" runat="server" Text='<%#Convert.ToInt32((12.5))%>'>

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