Markus Neteler wrote:
> It seems that the precision gets somewhere lost in
> db_convert_column_value_to_string()
>
> i.e. lib/db/dbmi_base/columnfmt.c
>
> but I don't find where is is rounded.
lib/db/dbmi_base/valuefmt.c db_convert_value_to_string() does:
case DB_C_TYPE_DOUBLE:
sprintf (buf, "%lf",db_get_value_double(value));
G_trim_decimal(buf);
the %lf is rounding to %.6f?
maybe
- "%lf"
+ "%.14f"
then let G_trim_decimal() remove any extra .00000s.
but maybe such noisy output is not always wanted. :-/
(e.g. pretty output for d.what.vect tcl form)
?
FWIW v.out.ascii defaults to dp=8.
for the v.colors script, SQL "select * WHERE dbl_col = <FP number>" is
always going to be problematic.
the C way:
if( abs(test - value) < GRASS_EPSILON )
Hamish
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev