How do Europeans write a list of numbers with decimal places?

As I understand it, Europeans (*) write comma-separated numbers for the decimal separator, so one-quarter is written as 1,25

Europeans also use commas to separate lists, so how do you write a list of decimal numbers? I, as an Englishman, will write one or two quarters, one and a half, one or three quarters like this:

 1.25, 1.5, 1.75 

How do you do it in Europe?

(Why is this a programming issue? Because I'm writing a program that will ask European users for a list of numbers!)

* For the purposes of this issue in Europe there are no English-speaking countries .:-) sub>

+6
source share
4 answers

It depends on the culture and culture. The CLDR data contains a β€œlist” element t that defines the list separator character, and this is a semicolon for most cultures, see the numeric character diagram (list element). However, the definition is very implicit, and there are differences within the locales. Some people find 1.25, 1.5, 1.75 acceptable, while others prefer 1.25; 1.5; 1.75. There are also people who seriously think that in a strongly mathematical or numerical context, one should deviate from the practice of the locale and use Anglo-Saxon notation with a decimal point, therefore with a semicolon as a separator.

On the practical side, I think it would not be very wrong to use ";" as a separator of lists of numbers when using a decimal point or even when using a decimal point. So you can even consider using ";" in all locales.

But when it comes to user input, it is more complicated. In principle, you are free to accept, but since the comma can be a decimal point, thousands separator, or list separator, there is such a thing as too liberal.

If possible, request each number separately, avoiding the delimiter problem. If this is not possible, it is imperative to make the very, very expected use of the separator very clear. I would say that requiring a semicolon ";" this is the most reliable thing.

+3
source

I am European (French), and in almost all programs here we should use semicolons ';' as a separator, even if the numbers are integers, because the comma does not look like a separator for us. In math, semicolons are the only correct way to split a list of numbers.

The most common example is when we need to enter the page numbers that we want to print in a PDF file, all programs ask for a comma-delimited list, and I clearly found it intuitive. I think they would change it if someone was uncomfortable.

+4
source

Why ask about Europeans in general? I do not think that there is one European way to do this, and if that happens, then it will be just luck. Europe consists of different cultures, and each of them has its own rules.

You do not indicate which platform you are using, but you can rely on your form to receive this information. In the case of .NET, you can get this information through Textinfo.ListSeparator . For example, this will give you French (result: semicolon):

 string listSeparator = new CultureInfo("fr-FR").TextInfo.ListSeparator; 
+3
source

I do not think there is one way to do this. The white space separating the numbers will work the same way, or you can use a semicolon ( ';' ) to separate the numbers

+1
source

Source: https://habr.com/ru/post/918488/


All Articles