handsontable/handsontable — pull request #1952 by paulo-raca (2014-12-02 20:23:03+00:00)
Title: Numeral lang

My native language is portuguese, and therefore my 'default' decimal separator is comma instead of common dot. This causes several minor bugs, which I'm trying to fix.

* Handsontable sometimes changes numerical.language() -- e.g., when I specify "language=xx" -- , but it never changes it back afterwards. This is specially annoying on columns that use the "default" language: They are shown in whatever language was selected last.

* When parsing numeric values, instead of assuming english as the default language, just keep using the current numerical.language() -- Which defaults to english, so you usually don't need to worry

* In portguese (and other languages), the dot is supposed to be a thousand-delimited, therefore "1.000" should be parsed as "1000" instead of "1". But we hardly see it used anywhere.

On the other hand, using dot as a decimal delimiter is quite common, and it is convenient to be able to parse it. Therefore i modified the parsing code to assume english whenever there is a dot and there is no comma.

This replaces the current hack that assumes english when there is no commas and the dot is in the position length-3 (2 decimals)

* Last, when copying data (Ctrl-C), I want the number to be copied using my languages's decimal separator -- Otherwise Excel gets unhappy when I paste it.