I am trying to read a long number from the xls file (6425871003976), but python continues to translate it before it reads it as a number, not a string (6.42587100398e + 12). Is there any method for reading it directly as a string, even if you are in the xls file, is that a number?
values = sheet.row_values(rownum)
in the values ββit is displayed correctly (6425871003976.0), but when I try to execute the values ββ[0], it has already switched to the wrong value.
Decision:
This was my solution using the repr () function:
if type(values[1]) is float: code_str = repr(values[1]).split(".")[0] else: code_str = values[1] product_code = code_str.strip(' \t\n\r')
source share