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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -