[Spam/Pourriel] [GRASS-dev] Re: query vector points x,y
Damiano Triglione
damiano.triglione at polimi.it
Wed Sep 27 12:08:11 EDT 2006
----- Original Message -----
From: "Hamish" <hamish_nospam at yahoo.com>
To: "Patton, Eric" <epatton at nrcan.gc.ca>
Cc: <damiano.triglione at polimi.it>; <tutey at o2.pl>; <grass-dev at grass.itc.it>
Sent: Wednesday, September 27, 2006 5:56 PM
Subject: Re: [Spam/Pourriel] [GRASS-dev] Re: query vector points x,y
> Patton, Eric wrote:
>>
>> True enough. I'm not sure why v.to.db only prints a few decimal
>> places. I'm assuming there must be some print statement within one of
>> the c programs of v.to.db that determines this.
>
>
> probably lib/db/dbmi_base/valuefmt.c
>
> For GRASS 6.1 I changed db_convert_value_to_string() there to do:
> case DB_C_TYPE_DOUBLE:
> sprintf (buf, "%lf",db_get_value_double(value));
> G_trim_decimal(buf);
> break;
>
> which helps.
>
> Damiano: are you using 6.1+? 6.0 will trim decimals as "%f" or so.
> Maybe there are more places that need the above fix.
>
> %lf prints with double precision and G_trim_decimal() removes trailing
> zeros.
>
>
> Hamish
Actually I am using 6.0. So: "%f", instead of "%lf", causes the single
(rather than double) precision in sprintf, right?
Damiano
More information about the grass-dev
mailing list