This project has moved. For the latest updates, please go here.

Formatting issue

Aug 13, 2013 at 9:37 PM
I'm building a data table dynamically from a list of objects. When I give it a decimal with formatting down to 2 decimal points it just rounds it to the nearest whole number.

I've tried this on inserting the data to the table:

row[prop.Header] = Math.Round((decimal)value, 2);

and then formatting it like so:

ws.Column(i + 1).Style.Numberformat.Format = "#,##0.00";

I tried it with just the formatting string but it doesn't seem to work that way either. I'm also having issues with the formatting when doing percents but I can get around that by telling it is a string.