Rounding Datasets/Datagrids

  • Thread starter Thread starter Les Hughes
  • Start date Start date
L

Les Hughes

Hey

I am doing a basic report using a dataset and datagrid, and would like
to round some of the decimal values (to 1 and 2 places) as some of the
values go down to 8 decimal places, anyone know an easy way to do this?


Thanks in advance,

Les :)
 
Hi Les,

Use:

Decimal.Round(cdec(objDR("decimalfield")), 2)

That will give you a value rounded to 2 decimal places. objDR represents a
DataRow object. You can convert the line above to a string using CStr() and
assign the value as a string wherever it needs to go. Good luck! Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top