0

While writing the excel file is fine I see that really long numbers are scientific notations in excel

Example: 8.71129E+12

instead of: 1234567890

How can I do it in Java

I am writing like

String nart = "1236547865452";
csvWriter.append(nart);
nealmegh
  • 25
  • 8
  • That is not a formula; it is scientific notation. – Scott Hunter Dec 05 '18 at 00:16
  • Is there anyway I can stop excel from converting it. And show the numbers as string without manually changing the format of the column. – nealmegh Dec 05 '18 at 00:18
  • https://superuser.com/questions/452832/turn-off-scientific-notation-in-excel and may be try this https://stackoverflow.com/questions/46431561/apache-poi-dataformatter-returns-scientific-notation – Ryuzaki L Dec 05 '18 at 00:52

1 Answers1

0

Not sure how the same can be achieved using writing to simple CSV? ,

but through APACHE POI You can write to excel and you need to do set the cell type if you want to see the whole value like 1236547865452 cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); and this is not needed it you have to see scientific notation as 8.71129E+12

Yugansh
  • 365
  • 3
  • 9