Home All Groups Group Topic Archive Search About

Round to 2 decimals in a Datalist

Author
9 Oct 2006 3:06 PM
Christine
Hi,
I am creating a datalist and have the following lines of code:

<tr><td>'<%#DataBinder.Eval(Container.DataItem, "PBBLS")%>'</td></tr>
<tr><td>'<%#DataBinder.Eval(Container.DataItem, "SBBLS")%>'</td></tr>

I need to round PBBLS and SBBLS up to 2 decimal places. There are
currently 4. I am getting these values from an OleDb Connection inside
of a table.
Any help would be appreciated. Thanks!

Author
9 Oct 2006 3:09 PM
Christine
Forgot to add that I am of course using VB.NET.
Author
9 Oct 2006 3:36 PM
rowe_newsgroups
system.math.round

Thanks,

Seth Rowe


Christine wrote:
Show quoteHide quote
> Forgot to add that I am of course using VB.NET.
Author
9 Oct 2006 6:24 PM
Christine
I changed the code to:

'<%#Math.Round(DataBinder.Eval(Container.DataItem, "PBBLS"), 2)%>'

And it works great! Thanks.