[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-datamash] Decimal separator
From: |
Assaf Gordon |
Subject: |
Re: [Bug-datamash] Decimal separator |
Date: |
Tue, 2 Aug 2016 23:14:25 -0400 |
Hello,
> On Jul 29, 2016, at 08:08, Maxime Jay-Allemand <address@hidden> wrote:
>
> I encountered a little trouble with the decimal separator using Datamash. The
> default behaviour is that Datamash use the comma separator instead of the
> point. Is there any way to change this behaviour before invoking Datamash
> (options) ?
By default, 'datamash' uses the current locale's definition for decimal
separator.
Based on your email domain (.fr) - perhaps your current locale is fr_FR.UTF-8 ?
In that case, 'datamash' would assume a comma is the decimal separator.
This can be observed with 'printf' (assuming these locales are installed on
your machine):
$ LC_ALL=en_US.UTF-8 env printf "%'f\n" 1.5
1.500000
$ LC_ALL=fr_FR.UTF-8 env printf "%'f\n" 1.5
1,500000
> I am using Ubuntu 16.04, and the current Datamash version is 1.0.7.
>
> I found a simple workaround by setting the locale to C and then run Datamash
> : export LC_ALL=C
Not only a work-around, but this is the recommended way.
However, I do note that other GNU utilities seem to ignore current locale when
parsing input and always accept decimal point - I'll consult others and see if
that is a recommended approach.
Thank you for reporting this issue.
regards,
- assaf
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Bug-datamash] Decimal separator,
Assaf Gordon <=