D
D. Shane Fowlkes
I have a DataItem in a Template that calls a Function to perform a
calculation. The Function returns a decimal value. Easy enough. It looks
like this:
<code>
<%# CalculateExpended(Container.DataItem("StaffID")) %>
</code>
So how exactly can I format this to come out as currency? I can NOT format
the output in the function. The function must return a decimal. I've tried
something like the code below but that returns a "'System.Decimal' does not
contain a property with the name {0:C}. " error.
<code>
<%# DataBinder.Eval(CalculateExpended(Container.DataItem("StaffID")),
"{0:C}") %>
</code>
Thanks
Just to emphasize - I cannot perform the formatting within the function! I
must do this at the Template's DataItem level in the page. Thanks again...
calculation. The Function returns a decimal value. Easy enough. It looks
like this:
<code>
<%# CalculateExpended(Container.DataItem("StaffID")) %>
</code>
So how exactly can I format this to come out as currency? I can NOT format
the output in the function. The function must return a decimal. I've tried
something like the code below but that returns a "'System.Decimal' does not
contain a property with the name {0:C}. " error.
<code>
<%# DataBinder.Eval(CalculateExpended(Container.DataItem("StaffID")),
"{0:C}") %>
</code>
Thanks
Just to emphasize - I cannot perform the formatting within the function! I
must do this at the Template's DataItem level in the page. Thanks again...