Excel单元格一般fromat解释

在决定closures之前阅读。

我正在使用Apache POI事件库来读取excel文件,当单元格的数值types,并没有任何格式与它关联时,我得到的Excel绝对值保存。 我想知道excel如何显示为40.33,因为我需要这样做。

我想知道excel如何解释一般格式的单元格。 例如,如果我有一个单元格中的40.33,它将被保存为40.332999999999998。 使用通用格式,excel如何知道如何显示40.33当值保存16位小数。 另请注意,值40.33没有s属性。 所以没有与之相关的风格

<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:x14ac="http: //schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"> <dimension ref="A1:A3"/> <sheetViews> <sheetView tabSelected="1" workbookViewId="0"> <selection activeCell="A5" sqref="A5"/> </sheetView> </sheetViews> <sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/> <sheetData> <row r="1" spans="1:1" x14ac:dyDescent="0.25"> <cr="A1"> <v>40.332999999999998</v> </c> </row> <row r="2" spans="1:1" x14ac:dyDescent="0.25"> <cr="A2" s="1"> <v>20</v> </c> </row> <row r="3" spans="1:1" x14ac:dyDescent="0.25"> <cr="A3" s="2"> <v>0.2</v> </c> </row> </sheetData> <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/> <pageSetup orientation="portrait" r:id="rId1"/> </worksheet>