Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
isnull(A.Per,0)>0 then cast(A.Per as varchar) else '' end As Per

in repeater values are stil showing like 44.00
i facing problem in using ternary operator in repeater's Eval()
reply
Posted
Updated 6-Mar-12 22:35pm
v4
Comments
Anuja Pawar Indore 1-Mar-12 4:20am    
Why again repost
Kiirrii 1-Mar-12 5:00am    
hey your solution not works yaar.... i have tried it... send me one more time...

Hi,
Use This
C#
<%#Eval("Val").ToString().Split('.')[0]%>

Best Luck
 
Share this answer
 
This is third time you are posting your question. Why don't you use Improve question link and update your previous questions.
1. Time
i want to display numeric(9,2) values as integer in repeater[^]
2. Time
i want to display numeric(9,2) values as integer only if no is 12.00 or anything .00 as 12 i want remove .00[^]
 
Share this answer
 
Comments
Nilesh Patil Kolhapur 1-Mar-12 5:33am    
Hi Try My Solution
DataFormatString="{0 : D}" add this attribute on that column  
 
Share this answer
 
v2
Comments
Kiirrii 1-Mar-12 5:42am    
i m trying this from yesterday its not working... even i tried {0:P} also to show percentage symbol in repeater or grid reply.....
Kiirrii 2-Mar-12 4:34am    
how to write that inside Eval its not working i tried lot...
Kiirrii 2-Mar-12 4:36am    
if write as Eval("Per"),"{0:d}") its not working...
in repeater 

<div>

< %#GetFormatvalue(Eval("Val")) %>
</div>
public string GetFormatvalue( object val)
{
    int i=Convert.ToInt32(val);
  return convert.ToString(i);
}
 
Share this answer
 
Comments
Kiirrii 2-Mar-12 4:43am    
showing error like string is not in correct format..

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