[Spam/Pourriel] [GRASS-dev] Re: query vector points x,y

Hamish hamish_nospam at yahoo.com
Wed Sep 27 11:56:21 EDT 2006


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




More information about the grass-dev mailing list