Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wanted to fecth a value such as 0.2
and I wanted to show it such as 0.20 for better understanding .
How can I do ths ?
Posted
Updated 25-Mar-14 23:17pm
v2

 
Share this answer
 
Comments
Ni!E$H_WAGH 10-Mar-14 6:38am    
Thanks Kedar0011 but am fetching the value from database ....
Try this code

String.Format("{ 0: 0.00}", <your number="">);
 
Share this answer
 
Comments
Ni!E$H_WAGH 10-Mar-14 6:39am    
Thanks ..Singh Rajan . But I wanted to show this value from database using eval() in gridview like <itemtemplate><asp:Label ID="txtweight_fact" runat="server" Height="25px" text='<%#Eval("MBO_Weighting_Factor")%>' Width="30px">
Thanks everybody who involved in this question .
I got the solution to display the float value upto two decimal places
Text='<%# Eval("Datafield", "{0:#,##0.00}") %>'
 
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