This project has moved and is read-only. For the latest updates, please go here.

Getting the Formatted Text of a field.

Nov 20, 2015 at 11:15 PM
I am reading an existing value from an excel spreadsheet.
        ExcelPackage pack = new ExcelPackage(new FileInfo(@"MoneyTest.xlsx"));
        var sheet = pack.Workbook.Worksheets.First();
        var cell = sheet.Cells[sheet.Dimension.Start.Row + 1, sheet.Dimension.Start.Column];
        MessageBox.Show(cell.Text);
        MessageBox.Show(cell.Value.ToString());
The value in the cell is "5" and it contains the currency formatting so it displays as "$5.00" in excel.

The above code produces "$0.05" for the cell.Text and "5" for the cell.Value.

Is there a way to read the cell text as "$5.00" instead of "$0.05" without me manually parsing the cell.Value?

Thanks.
Nov 20, 2015 at 11:52 PM
Disregard this. When I initially tested updating the package, I did it wrong. But after trying this again, Nuget package 4.0.4 resolved the issue.

Thanks.