Hi GTTravis,
You can do it in two ways. Inside the html and in code behind aswell.
In Html
<asp:Label ID="lblAmount" runat="server" Text='<%#Convert.ToDecimal(Eval("Amount")).ToString("c")%>'></asp:Label>
OR
In code behind ItemDataBound event
C#
protected void lvwCustomers_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
Label amount = e.Item.FindControl("lblAmount") as Label;
amount.Text = Convert.ToDecimal(amount.Text.Trim()).ToString("c");
}
}
VB.Net
Protected Sub lvwCustomers_ItemDataBound(sender As Object, e As ListViewItemEventArgs)
If e.Item.ItemType = ListViewItemType.DataItem Then
Dim amount As Label = TryCast(e.Item.FindControl("lblAmount"), Label)
amount.Text = Convert.ToDecimal(amount.Text.Trim()).ToString("c")
End If
End Sub
Output
$5,000.00