velofrog / readxlsb

Import Excel binary (.xlsb) spreadsheets into R
19 stars 2 forks source link

Large negative numbers incorrectly read #8

Open icantell opened 3 years ago

icantell commented 3 years ago

Hi,

working on a binary excel file I have problems with this numbers:

-12811.27 -> is read as -> 10724606.55 (interestingly the difference of 2 numbers gives 10737418.24 = 2^30 / 100 ) -190565.87 -> is read as -> 10546852.37 (here the same, the difference return 10737418.24 = 2^30 / 100 )

the same numbers without decimal are read correctly, eg.:

-12811.0 -> -12811.0

no errors for positive numbers on the same column.

Here the code I used:

read_xlsb(wb,"mytab",range=range, col_names = F)

icantell commented 3 years ago

Even with passed col_types, I got same numbers,

Thank you

jfunction commented 3 years ago

I am also seeing this same issue. I missed that it is 2^30/100, nice catch. I tried digging into this library to see if it was anything obvious with no luck. I had the same issue but can't seem to construct a smaller (less confidential) dataset to reproduce.

tungttnguyen commented 3 years ago

Has anyone tried using Python packages (pyxlsb or pyxlsb2 via reticulate) to work around some of the limitations of readxlsb?