java - reading excel file using XMLStreamReader ( read number as string, not as a number ) -
i reading excel file using xmlstreamreader object. initialization of object :
opcpkg = opcpackage.open(excelpath, packageaccess.read); xssfreader = new xssfreader(opcpkg); factory = xmlinputfactory.newinstance(); iterator = xssfreader.getsheetsdata(); inputstream = iterator.next(); xmlreader = factory.createxmlstreamreader(inputstream);
the contents of cell read using statement,
xmlreader.getelementtext();
the problem simple number string 10.2 contained in cell being read 10.199999999999999. want read 10.2 only. there way solve ?
when read string, parse
double.parsedouble(...gettext() );
that surest way number out of line of text
Comments
Post a Comment