#720: G_trim_decimal(): don't chop 0s on strings ending in e+20
-----------------------+----------------------------------------------------
Reporter: hamish | Owner: [email protected]
Type: defect | Status: new
Priority: critical | Milestone: 6.4.0
Component: libgis | Version: 6.4.0 RCs
Resolution: | Keywords: G_trim_decimal
Platform: All | Cpu: All
-----------------------+----------------------------------------------------
Comment (by hamish):
comments?
{{{
Index: lib/gis/trim_dec.c
===================================================================
--- lib/gis/trim_dec.c (revision 38754)
+++ lib/gis/trim_dec.c (working copy)
@@ -14,6 +14,7 @@
* \date 1999-2008
*/
+#include <string.h>
#include <grass/gis.h>
@@ -30,6 +31,10 @@
{
char *mark;
+ /* don't trim e+20 into e+2 */
+ if( strchr(buf, 'e') || strchr(buf, 'E') )
+ return 0;
+
/* find the . */
while (*buf != '.')
if (*buf++ == 0)
}}}
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/720#comment:1>
GRASS GIS <http://grass.osgeo.org>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev