【发布时间】:2014-05-09 16:41:09
【问题描述】:
我有以编程方式在电子表格中插入单元格的 c# 代码。我无法为这些单元格设置百分比格式:
Cell cell = OpenXmlHelper.GetCell(ws, address);
if (cell == null)
{
cell = InsertCellInWorksheet(ws, rowIndex, column);
}
cell.DataType = CellValues.Number;
cell.CellValue = new CellValue(value.ToString());
我需要一些设置Percentage 的代码,而不是cell.DataType = CellValues.Number;。
你能给我一些关于openxml中excel单元格格式百分比的线索或教程吗?
与Open Xml Excel set cell format to be Percentage 相比 我有数字 0.08,我需要将其显示为 8%。
【问题讨论】: