easyloggingpp icon indicating copy to clipboard operation
easyloggingpp copied to clipboard

Second decimal mark

Open adah1972 opened this issue 8 years ago • 3 comments

I understand using , or . or other character is a cultural issue, and usage varies across different regions. This said, the current international standards (like ISO 8601) tend to use . for such purposes. I would recommend using . as the default separator too, i.e. making the default datetime specifier %datetime{%Y-%M-%d %H:%m:%s.%g} instead of %datetime{%Y-%M-%d %H:%m:%s,%g}.

adah1972 avatar Jan 17 '17 10:01 adah1972

A reference: https://en.wikipedia.org/wiki/Decimal_mark

Honestly, I did not know there are more countries that use a decimal comma than countries that use a decimal point. Some interesting points:

In 1958, disputes between European and American delegates over the correct representation of the decimal mark nearly stalled the development of the ALGOL computer programming language.[Ha ha] ALGOL ended up allowing different decimal marks, but most computer languages and standard data formats (e.g. C, Java, Fortran, Cascading Style Sheets (CSS)) specify a dot.

In countries with a decimal comma, the decimal point is also common as the "international" notation because of the influence of devices, such as electronic calculators, which use the decimal point.

SI style: 1 234 567.89 or 1 234 567,89 (in their own publications, the dot "." is used in the English version, and the comma "," in the French version).

So I guess the decimal point is not that standardized as I thought, but is still preferred in the English/computing contexts.

adah1972 avatar Jan 17 '17 14:01 adah1972

According to ISO8601, comma is the recommended decimal separator (but dot is allowed, as well):

[...] the decimal fraction shall be divided from the integer part by the decimal sign specified in ISO 31-0, i.e. the comma [,] or full stop [.]. Of these, the comma is the preferred sign.

chausner avatar Dec 11 '23 17:12 chausner

The default C locale never uses such conventions. It is inconsistent with the rest of the system in its default behaviour. Inconsistency is always a bad thing.

According to ISO8601, comma is the recommended decimal separator (but dot is allowed, as well):

[...] the decimal fraction shall be divided from the integer part by the decimal sign specified in ISO 31-0, i.e. the comma [,] or full stop [.]. Of these, the comma is the preferred sign.

adah1972 avatar Dec 12 '23 02:12 adah1972