A
Alan Silver
Hello,
I have a repeater on a page, and one of the data items is a price. I
would like to be able to format this to ensure it has two decimal
places, but can't work out how to do it.
Suppose the ItemTemplate contains...
<li>£<%#DataBinder.Eval(Container.DataItem, "priceeach")%>
I have tried adding .ToString("f") on the end of the DataBinder call,
but that gave a compiler error that there wasn't an overloaded version
of ToString() that matched.
How would I ensure that the data item is always given two decimal
places?
TIA
I have a repeater on a page, and one of the data items is a price. I
would like to be able to format this to ensure it has two decimal
places, but can't work out how to do it.
Suppose the ItemTemplate contains...
<li>£<%#DataBinder.Eval(Container.DataItem, "priceeach")%>
I have tried adding .ToString("f") on the end of the DataBinder call,
but that gave a compiler error that there wasn't an overloaded version
of ToString() that matched.
How would I ensure that the data item is always given two decimal
places?
TIA