pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LC_NUMERIC progress.


From: Ben Pfaff
Subject: Re: LC_NUMERIC progress.
Date: Thu, 27 Dec 2012 21:19:14 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Dec 24, 2012 at 09:40:03AM +0100, John Darrington wrote:
> On Sun, Dec 23, 2012 at 02:10:58PM -0800, Ben Pfaff wrote:
>      On Sun, Dec 23, 2012 at 11:03:14PM +0100, John Darrington wrote:
>      > I see that we are using dtoastr from gnulib in a few places.  There
>      > does not seem to be any locale independent version of this function.
>      > Either we will need to write one, or we will need to use something
>      > else.
>      
>      We should probably write a c_dtoastr().  It could be pretty simple, a
>      wrapper around dtoastr() that then searches for a comma and replaces it
>      by a period.
> 
> Ok.  I've pushed a change which does that.
> 
> I've also changed all the occurances of dtoastr to c_dtoastr where it was 
> clearly
> appropriate.
> 
> One place I'm not sure about is in src/data/csv-file-writer.c --
> perhaps this should also be changed, otherwise it'll produce commas
> which could erroneously be interpreted as field delimiters.

The client passes the decimal point that it wants in to the CSV writer,
so the code needs to change whatever decimal point it ends up with by
that one.  I applied a patch that implements the behavior.

(If the decimal point and the field delimiter end up the same, that's
still OK: it will just cause fields that contain a decimal point to be
quoted.)



reply via email to

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