I am populating a template field using the following code
<%# ((ListData)Container.DataItem).TotalMinutes / 60.00 %>
However, sometimes the returned value shows up like 40.5 or 29 or 34.75.
I would like it to always show the 2 decimal places whether it is 40.50 or 29.00 or 34.75.
The 2 decimal places should always show.
I also tried
<%# string.Format("{0:###.##}", (double)((PendingApprovalListData)Container.DataItem).TotalMinutes / 60D)%>
try this :
please DO notice it IS ROUNDING !!!
if you want cutiing :