xlnt icon indicating copy to clipboard operation
xlnt copied to clipboard

How to retrieve the original string when there's a value

Open alandefreitas opened this issue 2 years ago • 3 comments

I've parsed a document where I have a cell with the value 18,40. The parser cannot identify the locale, which is OK. value() returns 18.

The problem is to_string() returns 18,, which is kind of random and loses information. I've already inspected the cell_impl and can't find the original 18,40 anywhere.

Is there any way to retrieve this original string so I can at least parse it properly by myself? I've invested a lot in this application we don't want to start from scratch just because of this small problem.

alandefreitas avatar Jun 25 '22 07:06 alandefreitas

Oh.... I tried changing the locale at lots of places, in both LibreOffice and in the application, and nothing works. Even converting the cell to text fails. There must be some metadata making this difficult.

alandefreitas avatar Jun 25 '22 08:06 alandefreitas

I can help with this, but I'll need to see the XLSX file or XML of the worksheet.

tfussell avatar Aug 13 '22 19:08 tfussell

Hi! Thank you for the help.

I tried to replicate a minimal example here: https://gist.github.com/alandefreitas/210419f89c0d22736dad264a046c5f9c

It's been a while so I'm not sure that's exactly the same file with which I had the original problem, but that came from the same source.

alandefreitas avatar Aug 15 '22 08:08 alandefreitas