0

I am trying to read phone numbers from an excel file. The numbers written in the excel sheet are of format:

3211010101

Now when I use cell.getNumericCellValue() it gives a double with the format:

3.211010101E9

How can I covert this number to the format I require (the one in the excel file) or get the data in the correct format in the first place?

Furqan Tariq
  • 73
  • 1
  • 12

1 Answers1

0

Solved it using:

                        Double num = cell.getNumericCellValue();
                        DecimalFormat formatter = new DecimalFormat("#");
                        formatter.setMaximumFractionDigits(0);
                        String test = formatter.format(num);
Furqan Tariq
  • 73
  • 1
  • 12