S
S
starosta462020-05-20 13:30:40
go
starosta46, 2020-05-20 13:30:40

How can excel be parsed based on country and cell type?

Good afternoon, I tried to parse excel on go using two libraries:
github.com/tealeg/xlsx
github.com/360EntSecGroup-Skylar/excelize/v2

However, if you put the value 40.5 in the cell, then it will turn into 40.5 during parsing. Changing the cell type to tex, etc. Does not help. If you display information about a cell, then it is always numeric and in the Russian locale. If you put in the cell 40.5, 41.5, then everything is parsed normally.

Are there any libraries that take this into account or is there somewhere a set of rules by which excel understands how to display numbers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2020-05-20
@AUser0

So this is an old problem with Excel, treating strings as numbers if they look like numbers.
Put a single apostrophe ( ' ) at the beginning of such a string (the first character) - will not convert, and will not show the apostrophe itself in the cell.
I just don't know how the parsers will react to this trick.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question