Long number data coming as scientific notation

Hello,

We have a bot designed to pull data from an oracle database and update values in a Google Sheet based on a unique search term. The search term is the header_id number from the oracle database. This int value is 17 digits long, an example is 20221024013456206. When using SQL developer, I can see all the int values properly. However, when I output the header_id for each row in UiPath studio it is returning in scientific notation, for example, the int 20221024013456206 gets changed to 2.0221024013456002e16. How can I get the values from the database output in int format and not scientific format?

The reason I am asking for help is that we are seeing that if we convert the scientific format into int format, some integers are changed. For example, the output data in Studio comes as 2.02210240134565e16 but the actual number in the oracle database is 20221024013456499.

Hi @mehul.jethva

Try using int64 instead of int32.

Br

Hello,

We have tried using int64 and int32 but same issue. Is there another data type we can try?

Hi @mehul.jethva ,

Could you let us know what activities are being used to update values in a Google Sheet? Also, Have you tried writing the data to an Excel sheet in the system and checked the values ?

Additionally, also let us know how was the check done on values using Studio. Was Debugging used or was it done using a Write Line / Message Box Activity ?

Hi @supermanPunch

We are using the UiPath.Gsuite package activities. Inside the GSuite application scope, we are using the write cell activity. However, the issue is not related to Gsuite. It is related to UiPath retrieving data from a database and converting the 17 digit number into scientific notation. When we loop through the data returned by the database, we added a write line to display the number, it is in scientific notation. So there is an issue on the Studio side

@mehul.jethva ,

After the data is retrieved from the database as a Datatable, Was a Check done in Immediate Panel by performing a Debug to see if the Scientific Notation also Appears in the Immediate Panel ?

Also, Maybe a try on Writing the Datatable to an Excel Sheet after retrieved from DB and then using Format Cells Activity on that specific range of sheet could help in keeping the same format.

This doesn’t actually mean it would enter it in scientific notation into the Google Sheet. Have you actually done that step of writing into the Google Sheet - to see what format it ends up? It could just be the write line that’s converting it (by the way you should be using Log Message not write line).

Hi @supermanPunch

After the data is retrieved, I did a log message and a write line. In both cases, it displays the number in scientific notation.

I have also written the data into excel and tried to use Format cells. When I use format cells, for some reason excel removed the last few digits and replaces them with 0s. So writing to excel does not work

Hi @postwick

Yes, I have actually done the step to write into Google Sheets and it enters the numbers in scientific notation. Using format cells in Google Sheets also does not work, the numbers remain in scientific notation regardless of the format I change the cell/column. I have used both log messages and write line activities, in both cases the numbers is displayed in scientific notation

Run it in debug mode with a breakpoint just after the original data is read then look in the debug panel to see what the values are. Need to figure out if the conversion is happening on read, or on write.

I have done this and tried with the write line, log message and message box activities and they all display the number in scientific notation

Again, we need to know if it’s happening at output or is what is being stored. Put a breakpoint on the activity just after you read the data, run in Debug, and when it pauses at the breakpoint look at the value in the debug panel. What’s the datatype of the variable?