scm0sml
asked on
formatting a decimal inside repeater
Hi,
I have the repeater below.
The value that InvoiceAmount is giving is:
512.33000 or whatever - it is a decimal.
I need to format it to 2 decimal place.
I have tried:
<%#DataBinder.Eval(Contain er.DataIte m, "InvoiceAmount").ToString( "#00.00")% >
but get:
System.FormatException: Input string was not in a correct format.
What am I doing wrong?
I have the repeater below.
The value that InvoiceAmount is giving is:
512.33000 or whatever - it is a decimal.
I need to format it to 2 decimal place.
I have tried:
<%#DataBinder.Eval(Contain
but get:
System.FormatException: Input string was not in a correct format.
What am I doing wrong?
<asp:Repeater ID="rptResults" runat="server" >
<ItemTemplate>
<tr>
<td>
<%#DataBinder.Eval(Container.DataItem, "RegNumber")%>
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "SupplierOnInvoice.Name")%>
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "Payee.Name")%>
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "InvoiceAmount")%>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Go the answer myself.
One answer was correct for an old framework so have given some points.
One answer was correct for an old framework so have given some points.
ASKER
Source Error:
Line 187: </td>
Line 188: <td>
Line 189: <%#DataBinder.Eval(Contain
Line 190: </td>