[Top][All Lists]

[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: Sat, 11 Jun 2016 18:45:03 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

Hello Marin,

On 06/10/2016 05:44 AM, Martin Heller wrote:
From: Assaf Gordon [mailto:address@hidden


'datamash' uses a function called 'strtold' to convert numbers [1], and this
function respects the correct locale.
This is likely the reason for this unexpected behavior.

Yes, I realize this now. However, it was unexpected for me. E.g. calculating
the mean other tools using the same data.txt file works as expected:


t:\>awk "{ total += $1; count++ } END { print total/count }" data.txt


T:\>octave-cli.exe -qf --eval "d=load('data.txt');mean(d)"
ans =  4.5000

I even don't know if it is possible to get awk/Octave to expect anything
else than dot as the decimal mark.


Unfortunately, it does not work. Here is the output:

T:\>set LC_NUMERIC=C & set LC_LANG=C & set LC_ALL=C

T:\>set LC

T:\>cat data.txt | datamash-win32 mean 1
datamash-win32: invalid numeric value in line 1 field 1: '0.1'

Thanks for pointing this. I'll check with other programs how they handle this 
situation on Windows,
and if need be, adapt datamash accordingly.
I am not a programmer, so for me downloading the executable is
the preferred option.

I've built two new Windows executables (32bit and 64bit) using the latest 
with disabled locale setting (always using default "C" locale):


If you can, please test these and let me know if they work better.

 - assaf

reply via email to

[Prev in Thread] Current Thread [Next in Thread]