Round to 2 decimals in a Datalist

  • Thread starter Thread starter Christine
  • Start date Start date
C

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!
 
I changed the code to:

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

And it works great! Thanks.
 
Back
Top