vallettea / koala

Transpose your Excel calculations into python for better performances and scaling.
GNU General Public License v3.0
147 stars 59 forks source link

Function MID is incorrect #192

Closed ZloiGremlin closed 5 years ago

ZloiGremlin commented 5 years ago

Excel index char start from 1 in python index start is 0 Function of mid range is: return text[start_num - 1 : start_num + num_chars - 1]

brianmay commented 5 years ago

What version are you looking at? There have been some changes in master, so wondering if this problem might has already been fixed?

ZloiGremlin commented 5 years ago

I am look to master. Current version mid is return text[start_num: start_num + num_chars] https://github.com/anthill/koala/blob/master/koala/excellib.py#L711

brianmay commented 5 years ago

@danielsjf Have you encountered this issue?

danielsjf commented 5 years ago

@brianmay, as far as I know, my test excel files aren't using these.

From looking at the test (only one is actually performed), it actually looks like there is an issue (test might be wrong). https://github.com/anthill/koala/blob/08b053a570bb3f52378464824dd31d281affa6d5/tests/excel/test_functions.py#L458