easyloggingpp
easyloggingpp copied to clipboard
Second decimal mark
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}
.
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.
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.
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.