【问题标题】:Getting decimals in itextsharp pdf file在itextsharp pdf文件中获取小数
【发布时间】:2015-02-12 18:09:45
【问题描述】:

我一直在 iTextsharp 中导出 DataGridView,但是生成的 PDF 文件没有显示 win 表单上可见的小数。

dataGridView1.Columns[4].DefaultCellStyle.Format = "N2";

PdfPCell cell3 = new PdfPCell(new Phrase(cell.Value.ToString(), fontTitle));
                    cell3.HorizontalAlignment = Element.ALIGN_RIGHT;
                    pdfTable.AddCell(cell3);

【问题讨论】:

    标签: c# datagridview itextsharp


    【解决方案1】:

    使用 cell.FormatedValue 代替 cell.Value。 cell.value 是原始数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-12
      • 1970-01-01
      • 2019-05-01
      • 1970-01-01
      相关资源
      最近更新 更多