How to retrive Data in Number format from excel

I am using Data FIles to get data from Excel.


I have some values that are in Numbers format, I need to retrive it as Integer format, but all I am getting is String format.
Type casting is not an option in my scenario. I have already use that variable value in numerous places. I cannot just go every where and add type casting.

You have the options of importing data from Excel as either string or double:

Row row = sheet.getRow(1);
Cell cell = row.getCell(0);
GlobalVariable.gLastName = cell.getStringCellValue();

or

Row row = sheet.getRow(1);
Cell cell = row.getCell(0);
double money = cell.getNumericCellValue();

You can use the double version and implicitly downcast the value to an int, like below.

Row row = sheet.getRow(1);
Cell cell = row.getCell(0);
int shortTimeOut = cell.getNumericCellValue();

If you want to get to Integer format (the object not the primitive), then you will have to type cast.

Hello helpdesk,
Can you please provide the answer that uses Katalon Recorder commands?
Thank you.

Hi, check this: Please help on Katalon Recorder Data-Driven using CSV