Live data from Hacker News

Excel formulas in JavaScript

github.com

31–40 of 57 posts

Re: Excel formulas in JavaScript

#31
post #9

Any support for i18n? (For English-only speakers: Excel's translation to other languages goes as far as translating function names, thus rendering non-English Excel users' knowledge useless when confronted with an English Excel. E.g., IF(ROUND(A1)=1,B1,C1) in English Excel is JEŻELI(ZAOKR.DO.CAŁK(A1)=1,B1,C1) in Polish Excel -- yes, with all those funky non-ASCII letters.)

Every time I read some comment about how people shouldn't use excel for complex calculations and should use relational databases or Python or whatever else, I'll know why it will never happen.

It's really easy to implement the easy parts of spreadsheets, getting the hard parts right is why Excel continues to dominate the space.

Re: Excel formulas in JavaScript

#32

What licence is this under please? (MIT preferred!)

It's somewhat confusing. The structure is MIT licenses but the individual implementations have different licenses (for example, many functions were copied from OpenOffice (which is under Apache2 license)

Re: Excel formulas in JavaScript

#33

I honestly admire the thought and effort that went into it. I fear that JavaScript's use of floating point as its single numeric type is likely to create surprising results for the unwary. I have come to the suspicion that the longevity of Excel's dominance is in part due to a sophisticated system for inferring numeric types.

Excel only supports numbers that fit in an IEEE754 double, just like JavaScript.

There is some fancy logic to format numbers, however (including some mess for date codes). http://oss.sheetjs.com/ssf/ is a pretty decent implementation in JavaScript.

Re: Excel formulas in JavaScript

#34
post #9

Any support for i18n? (For English-only speakers: Excel's translation to other languages goes as far as translating function names, thus rendering non-English Excel users' knowledge useless when confronted with an English Excel. E.g., IF(ROUND(A1)=1,B1,C1) in English Excel is JEŻELI(ZAOKR.DO.CAŁK(A1)=1,B1,C1) in Polish Excel -- yes, with all those funky non-ASCII letters.)

Every time I read some comment about how people shouldn't use excel for complex calculations and should use relational databases or Python or whatever else, I'll know why it will never happen. It's really easy to implement the easy parts of spreadsheets, getting the hard parts right is why Excel continues to dominate the space.

There is a good reason why no one has unseated excel: it's easy to build the really easy 80%, but the last 20% is incredibly difficult and time consuming.

Re: Excel formulas in JavaScript

#35
post #9

Any support for i18n? (For English-only speakers: Excel's translation to other languages goes as far as translating function names, thus rendering non-English Excel users' knowledge useless when confronted with an English Excel. E.g., IF(ROUND(A1)=1,B1,C1) in English Excel is JEŻELI(ZAOKR.DO.CAŁK(A1)=1,B1,C1) in Polish Excel -- yes, with all those funky non-ASCII letters.)

Every time I read some comment about how people shouldn't use excel for complex calculations and should use relational databases or Python or whatever else, I'll know why it will never happen. It's really easy to implement the easy parts of spreadsheets, getting the hard parts right is why Excel continues to dominate the space.

It's a shame Scheme in a grid appears to be abandoned (if anyone manages to build it under, say, the latest Debian Stable, please let me know):

http://siag.nu/siag/

Re: Excel formulas in JavaScript

#36
post #9

Any support for i18n? (For English-only speakers: Excel's translation to other languages goes as far as translating function names, thus rendering non-English Excel users' knowledge useless when confronted with an English Excel. E.g., IF(ROUND(A1)=1,B1,C1) in English Excel is JEŻELI(ZAOKR.DO.CAŁK(A1)=1,B1,C1) in Polish Excel -- yes, with all those funky non-ASCII letters.)

That's the reason I always use the English version of Office. But then it's so weird when I go help some colleague and they're using the local version, and I'm suddenly a beginner... A remainder of the old world in today's hyper-globalized world.

That's the reason I always use the English version of everything. What I find most ridiculous is when hotkeys get translated, ex. Ctrl+S is Underline in Spanish (Subrayar)

Re: Excel formulas in JavaScript

#37
post #36

Earlier quoted context omitted.

That's the reason I always use the English version of Office. But then it's so weird when I go help some colleague and they're using the local version, and I'm suddenly a beginner... A remainder of the old world in today's hyper-globalized world.

That's the reason I always use the English version of everything. What I find most ridiculous is when hotkeys get translated, ex. Ctrl+S is Underline in Spanish (Subrayar)

It never occurred to me that other languages would have different hot-keys. Intuitively it makes sense, but damn I imagine a lot of programs don't do it so it must be a horribly inconsistent experience (I get angry when a program fails to support something like CTRL-W to close windows or CTRL-A for select all or the inconsistency between some using ctrl-shift-Z or ctrl-Y for redo).

I guess that's the advantage to the old Word Perfect approach of function-keys for everything (provided you have one of those nifty overlays that show you all the key-commands).

Re: Excel formulas in JavaScript

#38
post #9

Any support for i18n? (For English-only speakers: Excel's translation to other languages goes as far as translating function names, thus rendering non-English Excel users' knowledge useless when confronted with an English Excel. E.g., IF(ROUND(A1)=1,B1,C1) in English Excel is JEŻELI(ZAOKR.DO.CAŁK(A1)=1,B1,C1) in Polish Excel -- yes, with all those funky non-ASCII letters.)

Every time I read some comment about how people shouldn't use excel for complex calculations and should use relational databases or Python or whatever else, I'll know why it will never happen. It's really easy to implement the easy parts of spreadsheets, getting the hard parts right is why Excel continues to dominate the space.

Ironically, Excel fails miserably at implementing the easy parts of a database.

Seriously, how much does doing a simple "Select Distinct" suck in Excel?

Re: Excel formulas in JavaScript

#39
post #11
post #10

Earlier quoted context omitted.

This also includes changing argument separators according to the locale. In France, for instance, where commas are used as decimal separators, function arguments must be separated by semicolons. Faithful i18n should take both into account.

Luckily this is a UI thing and the files themself normalize to English. So the project could still be useful for opening Excel files on the web (theoretically).

Oooh, so if I make a spanish excel file and open it in an english excel, the function names are all translated?

That's actually pretty neat. Power of storing your equations in a binary format instead of plain text, I guess.

Re: Excel formulas in JavaScript

#40
post #33

I honestly admire the thought and effort that went into it. I fear that JavaScript's use of floating point as its single numeric type is likely to create surprising results for the unwary. I have come to the suspicion that the longevity of Excel's dominance is in part due to a sophisticated system for inferring numeric types.

Excel only supports numbers that fit in an IEEE754 double, just like JavaScript. There is some fancy logic to format numbers, however (including some mess for date codes). http://oss.sheetjs.com/ssf/ is a pretty decent implementation in JavaScript.

All versions of Excel have native support for integers.

http://msdn.microsoft.com/en-us/library/office/bb687869%28v=...

Post reply on HN