00da38628aeeaaa58d2fff4202f7fd9107243d00
braney
  Sat Mar 14 13:54:48 2020 -0700
tweak shorterDouble() to always use %.15g and call it in a few more
places to get around %g's irritating practice of going into scientific
notation too early.

diff --git src/lib/common.c src/lib/common.c
index e6b6f06..15a1da2 100644
--- src/lib/common.c
+++ src/lib/common.c
@@ -3756,25 +3756,21 @@
 return cloneString(newDate);  // newDate is never freed!
 }
 
 boolean haplotype(const char *name)
 /* Is this name a haplotype name ?  _hap or _alt in the name */
 {
 if (stringIn("_hap", name) || stringIn("_alt", name))
    return TRUE;
 else
    return FALSE;
 }
 
 char *shorterDouble(double value)
 /* Work around a "bug" in %g output that goes into scientific notation too early. */
 {
-static char gbuffer[4096];
 static char g15buffer[4096];
 
-sprintf(gbuffer, "%g", value);
 sprintf(g15buffer, "%.15g", value);
 
-if (strlen(gbuffer) < strlen(g15buffer))
-    return gbuffer;
-return g15buffer;
+return cloneString(g15buffer);
 }