Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望网格视图中的单元格应该从 12.5 到 12 到 excel 导出。我发现一种解决方案是 gridRow.Cells(6).Attributes.Add("mso-number-format","0") 但它会将 12.5 舍入到 13
唯一可用的 excel 格式,如下面的链接所示
Excel 格式
在您的情况下,您可以做的是修剪小数部分,然后将其导出到 excel