2

I am using jxls for reading data from excel file. But there is something wrong when I tried to read a number like 12345678912: it would be transfer to 1.2345678E10 unless I set the format of this column to Text.

Is there anything I can do to solve this problem without setting the column to Text?

Anything help would be appreciated.

4
  • What data type you used for it ?
    – Hariharan
    Nov 5, 2013 at 9:32
  • use long data type and let me know whether it works @Chao
    – Hariharan
    Nov 5, 2013 at 10:39
  • It's String,but it's not the problem.
    – Chao
    Nov 5, 2013 at 10:42
  • I have tried,it doesn't work @Hariharan
    – Chao
    Nov 5, 2013 at 10:52

1 Answer 1

1

I was facing the same issue.. you can fix this by using NumberEval of org.apache.poi

Find the code below

 NumberEval t=new NumberEval(1.2345678E10);
 String temp= t.getStringValue(); //will give you exact string value and you can cast it to long

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.