Bug 59216 - Number cell value appends ".0" - issue with hyperlink
Summary: Number cell value appends ".0" - issue with hyperlink
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.14-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-22 22:03 UTC by terencem
Modified: 2016-03-22 22:05 UTC (History)
0 users



Attachments
XLSX containing numbers used as text (8.74 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-03-22 22:03 UTC, terencem
Details

Note You need to log in before you can comment on or make changes to this bug.
Description terencem 2016-03-22 22:03:30 UTC
Created attachment 33694 [details]
XLSX containing numbers used as text

When importing a number, it's value is listed with a decimal, ".0", on the end. This is not an issue when it is just a number as the decimal is stripped or ignored, but if it's meant to be text, it becomes an issue. Example file attached.

This is noticed when importing a working using:
Workbook workbook = new XSSFWorkbook(inputStream);
Where inputStream is a ByteArrayInputStream of the file.

It appears that the XML is correctly formatted:
<row r="2" spans="1:1" x14ac:dyDescent="0.25">
	<c r="A2" s="1">
		<v>22103</v>
	</c>
</row>

However the value is not:
workbook.getSheetAt(0).getRow(1).getCell(0).getNumericCellValue() = "22103.0"
Comment 1 Nick Burch 2016-03-22 22:05:42 UTC
getNumericCellValue returns a double, which will include a decimal point as per the Java Langauge spec

If you want a string of what your cell looks like in Excel, try DataFormatter.