miller icon indicating copy to clipboard operation
miller copied to clipboard

Configurable number formats, decimal separators, digit grouping

Open masgo opened this issue 2 years ago • 1 comments

A floating point number can be written with either a decimal point (1/4 = 0.25) or a decimal comma (1/4 = 0,25). While the point is commonly used in the US, China, India and many programming languages, the comma is is also quite widespread, especially in Europe, South America an Africa. (have a look at https://en.wikipedia.org/wiki/Decimal_separator#Usage_worldwide )

It would be nice if the decimal separator would be configurable in miller.

The digit grouping character should be configurable as well, since many European countries the point. So the US would write: 1,234.567 while Europe would write 1.234,567. This is also the reason why doing any type of auto detection is doomed to fail, as every European Excel user can tell you. Using the system locale is also a bad idea, since many European systems have to deal with US-style numbers. (= don't do it like Excel does it)

Grouping numbers with a space is also quite common (e.g. 1 234.567)

Negative numbers have a similar problem, while most people write -123, the format 123- is also quite widespread, especially in accounting. (I think since it makes it easier to recognize negative numbers in long, right aligned, columns of numbers) Sometimes there might be one or several spaces between the number and the minus sign.

I even encountered files where all things appeared simultaneously. So one column used US style numbers and another column used European numbers with a trailing minus. But luckily that's the exception.

masgo avatar Mar 14 '22 22:03 masgo

This feature is very useful specially when a document is exported as CSV or TSV.

The Spreadsheets installed on European computer may not correctly read decimal numbers separated by dot (".").

juanparati avatar Apr 03 '23 09:04 juanparati