欧洲人如何写带有小数的数字列表? [英] How do Europeans write a list of numbers with decimals?

查看:184
本文介绍了欧洲人如何写带有小数的数字列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,欧洲人(*)用逗号将数字写成小数点分隔符,因此四分之一写为1,25

As I understand it, Europeans(*) write numbers with a comma for a decimal separator, so one-and-a-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, would write one-and-a-quarter, one-and-a-half, one-and-three-quarters like this:

1.25, 1.5, 1.75

您如何在欧洲做到这一点?

How do you do that in Europe?

(为什么这是一个编程问题?因为我正在编写一个程序,向欧洲用户询问数字列表!)

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

*就此问题而言,欧洲没有英语国家. :-)

推荐答案

这随文化和文化的不同而不同. CLDR数据包含指定列表分隔符的列表"元素 t,它是有关大多数文化的分号,请参见数字符号图(元素列表").但是,该定义非常隐含,并且语言环境内部也存在差异.有些人认为1,25,1,5,1,75是可以接受的,而其他人则认为1,25. 1,5; 1,75.也有人认真地认为,在强烈的数学或数字上下文中,应该偏离语言环境的惯例,并使用带小数点的盎格鲁-撒克逊符号,因此使用逗号作为分隔符.

This varies by culture, and within a culture. The CLDR data contains the "list" element that specifies the list separator character, and it is the semicolon for most cultures, see the chart of number symbols (element "list"). The definition is very implicit though, and there is variation inside locales. Some people regard 1,25, 1,5, 1,75 as acceptable, while others prefer 1,25; 1,5; 1,75. There are also people who seriously think that in a strongly mathematical or numeric context, one should deviate from the locale practices and use the Anglo-Saxon notation with decimal point, hence with comma as separator.

从实际的角度来看,我认为使用;"并不是很错误.当使用小数逗号或什至使用小数点时,用作数字列表分隔符.因此,您甚至可以考虑使用;"在所有语言环境中.

On the practical side, I think it would not be very wrong to use ";" as number list separator when decimal comma is used, or even when decimal point is used. So you might even consider using ";" in all locales.

但是,当涉及到用户输入时,就比较棘手了.原则上,您接受的内容应该是自由的,但是由于逗号可以表示为十进制逗号,千位分隔符或列表项分隔符,因此有些东西太自由了.

But when it comes to user input, it’s trickier. In principle, you be liberal in what you accept, but since the comma can be meant to be a decimal comma, a thousands separator, or a list item separator, there is such a thing as being too liberal.

如果可能,请分别提示输入每个数字,以避免出现分隔符问题.如果无法做到这一点,那么关键的事情就是使使用起来非常清楚.我什至可以说要求分号为;"是最可靠的事情.

If possible, prompt for each number separately, avoiding the separator issue. If this is not possible, the crucial thing is to make it very, very clear to the use which separator is expected. I would go as far as saying that requiring for the semicolon ";" is the most reliable thing to do.

这篇关于欧洲人如何写带有小数的数字列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆