Commit 676d2c3a0 for imagemagick.org

commit 676d2c3a03e69a2e63cb2eb26e0db405d13cb19e
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Wed Jul 15 16:52:45 2026 -0400

    guarantee round-trip fidelity for IEEE‑754 doubles without printing spurious digits

diff --git a/Magick++/lib/Geometry.cpp b/Magick++/lib/Geometry.cpp
index 88b6bafdd..20e548edd 100644
--- a/Magick++/lib/Geometry.cpp
+++ b/Magick++/lib/Geometry.cpp
@@ -279,13 +279,13 @@ Magick::Geometry::operator std::string() const

   if (_width)
     {
-      FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _width);
+      FormatLocaleString(buffer,MagickPathExtent,"%.17g",(double) _width);
       geometry+=buffer;
     }

   if (_height)
     {
-      FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _height);
+      FormatLocaleString(buffer,MagickPathExtent,"%.17g",(double) _height);
       geometry+='x';
       geometry+=buffer;
     }
@@ -295,13 +295,13 @@ Magick::Geometry::operator std::string() const
       if (_xOff >= 0)
         geometry+='+';

-      FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _xOff);
+      FormatLocaleString(buffer,MagickPathExtent,"%.17g",(double) _xOff);
       geometry+=buffer;

       if (_yOff >= 0)
         geometry+='+';

-      FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _yOff);
+      FormatLocaleString(buffer,MagickPathExtent,"%.17g",(double) _yOff);
       geometry+=buffer;
     }

@@ -681,7 +681,7 @@ Magick::Point::operator std::string() const
   else
     point+="+";

-  FormatLocaleString(buffer,MagickPathExtent,"%.20g",_x);
+  FormatLocaleString(buffer,MagickPathExtent,"%.17g",_x);
   point+=buffer;

   if (_y < 0.0)
@@ -689,7 +689,7 @@ Magick::Point::operator std::string() const
   else
     point+="x+";

-  FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _y);
+  FormatLocaleString(buffer,MagickPathExtent,"%.17g",(double) _y);
   point+=buffer;

   return(point);
diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp
index 9199da1a6..42595a0a7 100644
--- a/Magick++/lib/Image.cpp
+++ b/Magick++/lib/Image.cpp
@@ -1511,7 +1511,7 @@ void Magick::Image::strokeWidth(const double strokeWidth_)

   modifyImage();
   options()->strokeWidth(strokeWidth_);
-  FormatLocaleString(value,MagickPathExtent,"%.20g",strokeWidth_);
+  FormatLocaleString(value,MagickPathExtent,"%.17g",strokeWidth_);
   (void) SetImageArtifact(image(),"strokewidth",value);
 }

diff --git a/Magick++/lib/Options.cpp b/Magick++/lib/Options.cpp
index 027d54719..fab192294 100644
--- a/Magick++/lib/Options.cpp
+++ b/Magick++/lib/Options.cpp
@@ -990,7 +990,7 @@ void Magick::Options::setOption(const char *name,const double value_)
   char
     option[MagickPathExtent];

-  (void) FormatLocaleString(option,MagickPathExtent,"%.20g",value_);
+  (void) FormatLocaleString(option,MagickPathExtent,"%.17g",value_);
   (void) SetImageOption(_imageInfo,name,option);
 }

diff --git a/MagickCore/accelerate.c b/MagickCore/accelerate.c
index aa5010f28..01d768d23 100644
--- a/MagickCore/accelerate.c
+++ b/MagickCore/accelerate.c
@@ -282,7 +282,7 @@ static cl_mem createKernelInfo(MagickCLDevice device,const double radius,
     i;

   (void) FormatLocaleString(geometry,MagickPathExtent,
-    "blur:%.20gx%.20g;blur:%.20gx%.20g+90",radius,sigma,radius,sigma);
+    "blur:%.17gx%.17g;blur:%.17gx%.17g+90",radius,sigma,radius,sigma);
   kernel=AcquireKernelInfo(geometry,exception);
   if (kernel == (KernelInfo *) NULL)
   {
diff --git a/MagickCore/animate.c b/MagickCore/animate.c
index 3ec2f8607..8e90942cd 100644
--- a/MagickCore/animate.c
+++ b/MagickCore/animate.c
@@ -975,11 +975,11 @@ MagickExport void XAnimateBackgroundImage(Display *display,
   if (resource_info->debug != MagickFalse)
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
-        "Image: %s[%.20g] %.20gx%.20g ",image_list[0]->filename,(double)
+        "Image: %s[%.17g] %.17gx%.17g ",image_list[0]->filename,(double)
         image_list[0]->scene,(double) image_list[0]->columns,(double)
         image_list[0]->rows);
       if (image_list[0]->colors != 0)
-        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.17gc ",(double)
           image_list[0]->colors);
       (void) LogMagickEvent(X11Event,GetMagickModule(),"%s",
         image_list[0]->magick);
@@ -1098,10 +1098,10 @@ MagickExport void XAnimateBackgroundImage(Display *display,
     if (resource_info->debug != MagickFalse)
       {
         (void) LogMagickEvent(X11Event,GetMagickModule(),
-          "Image: [%.20g] %s %.20gx%.20g ",(double) image_list[scene]->scene,
+          "Image: [%.17g] %s %.17gx%.17g ",(double) image_list[scene]->scene,
           image_list[scene]->filename,(double) columns,(double) rows);
         if (image_list[scene]->colors != 0)
-          (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+          (void) LogMagickEvent(X11Event,GetMagickModule(),"%.17gc ",(double)
             image_list[scene]->colors);
         (void) LogMagickEvent(X11Event,GetMagickModule(),"%s",
           image_list[scene]->magick);
@@ -1550,11 +1550,11 @@ MagickExport Image *XAnimateImages(Display *display,
   if (resource_info->debug != MagickFalse)
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
-        "Image: %s[%.20g] %.20gx%.20g ",display_image->filename,(double)
+        "Image: %s[%.17g] %.17gx%.17g ",display_image->filename,(double)
         display_image->scene,(double) display_image->columns,(double)
         display_image->rows);
       if (display_image->colors != 0)
-        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.17gc ",(double)
           display_image->colors);
       (void) LogMagickEvent(X11Event,GetMagickModule(),"%s",
         display_image->magick);
@@ -1673,7 +1673,7 @@ MagickExport Image *XAnimateImages(Display *display,
       */
       GetPathComponent(display_image->magick_filename,TailPath,filename);
       (void) FormatLocaleString(window_name,MagickPathExtent,
-        "%s: %s[scene: %.20g frames: %.20g]",MagickPackageName,filename,(double)
+        "%s: %s[scene: %.17g frames: %.17g]",MagickPackageName,filename,(double)
         display_image->scene,(double) number_scenes);
       (void) CloneString(&windows->image.name,window_name);
       (void) CloneString(&windows->image.icon_name,filename);
@@ -1952,10 +1952,10 @@ MagickExport Image *XAnimateImages(Display *display,
     if (image_list[scene]->debug != MagickFalse)
       {
         (void) LogMagickEvent(X11Event,GetMagickModule(),
-          "Image: [%.20g] %s %.20gx%.20g ",(double) image_list[scene]->scene,
+          "Image: [%.17g] %s %.17gx%.17g ",(double) image_list[scene]->scene,
           image_list[scene]->filename,(double) columns,(double) rows);
         if (image_list[scene]->colors != 0)
-          (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+          (void) LogMagickEvent(X11Event,GetMagickModule(),"%.17gc ",(double)
             image_list[scene]->colors);
         (void) LogMagickEvent(X11Event,GetMagickModule(),"%s",
           image_list[scene]->magick);
@@ -1983,7 +1983,7 @@ MagickExport Image *XAnimateImages(Display *display,
         while ((p > image_list[scene]->magick_filename) && (*(p-1) != '/'))
           p--;
         (void) FormatLocaleString(window_name,MagickPathExtent,
-          "%s: %s[%.20g of %.20g]",MagickPackageName,p,(double) scene+1,
+          "%s: %s[%.17g of %.17g]",MagickPackageName,p,(double) scene+1,
           (double) number_scenes);
         (void) CloneString(&windows->image.name,window_name);
       }
@@ -2107,7 +2107,7 @@ MagickExport Image *XAnimateImages(Display *display,
               while ((p > image_list[scene]->filename) && (*(p-1) != '/'))
                 p--;
               (void) FormatLocaleString(name,MagickPathExtent,
-                "%s: %s[%.20g of %.20g]",MagickPackageName,p,(double)
+                "%s: %s[%.17g of %.17g]",MagickPackageName,p,(double)
                 scene+1,(double) number_scenes);
               (void) CloneString(&windows->image.name,name);
               if (resource_info->title != (char *) NULL)
@@ -2969,7 +2969,7 @@ static MagickBooleanType XSaveImage(Display *display,
       /*
         Request JPEG quality from user.
       */
-      (void) FormatLocaleString(quality,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(quality,MagickPathExtent,"%.17g",(double)
         image_info->quality);
       status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
         quality);
diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c
index 07f0e30ca..7173a4410 100644
--- a/MagickCore/annotate.c
+++ b/MagickCore/annotate.c
@@ -2312,7 +2312,7 @@ static MagickBooleanType RenderPostscript(Image *image,
   text=DestroyString(text);
   (void) FormatLocaleFile(file,"showpage\n");
   (void) fclose(file);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g+0+0!",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g+0+0!",
     floor(extent.x+0.5),floor(extent.y+0.5));
   annotate_info=AcquireImageInfo();
   (void) FormatLocaleString(annotate_info->filename,MagickPathExtent,"ps:%s",
@@ -2358,7 +2358,7 @@ static MagickBooleanType RenderPostscript(Image *image,
       crop_info.y=CastDoubleToSsizeT(ceil((resolution.y/DefaultResolution)*
         extent.y/8.0-0.5));
       (void) FormatLocaleString(geometry,MagickPathExtent,
-        "%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+        "%.17gx%.17g%+.20g%+.20g",(double) crop_info.width,(double)
         crop_info.height,(double) crop_info.x,(double) crop_info.y);
       (void) TransformImage(&annotate_image,geometry,(char *) NULL,exception);
     }
diff --git a/MagickCore/blob.c b/MagickCore/blob.c
index 13c210229..f8b340738 100644
--- a/MagickCore/blob.c
+++ b/MagickCore/blob.c
@@ -3486,11 +3486,11 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,

               GetPathComponent(image->filename,RootPath,path);
               if (*extension == '\0')
-                (void) FormatLocaleString(filename,MagickPathExtent,"%s-%.20g",
+                (void) FormatLocaleString(filename,MagickPathExtent,"%s-%.17g",
                   path,(double) image->scene);
               else
                 (void) FormatLocaleString(filename,MagickPathExtent,
-                  "%s-%.20g.%s",path,(double) image->scene,extension);
+                  "%s-%.17g.%s",path,(double) image->scene,extension);
             }
           (void) CopyMagickString(image->filename,filename,MagickPathExtent);
         }
@@ -3530,7 +3530,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
             (void) fflush(blob_info->file_info.file);
 #endif
             (void) LogMagickEvent(BlobEvent,GetMagickModule(),
-               "  read %.20g magic header bytes",(double) count);
+               "  read %.17g magic header bytes",(double) count);
 #if defined(MAGICKCORE_ZLIB_DELEGATE)
             if (((int) magick[0] == 0x1F) && ((int) magick[1] == 0x8B) &&
                 ((int) magick[2] == 0x08))
diff --git a/MagickCore/cache.c b/MagickCore/cache.c
index 27e549b06..8bb81d542 100644
--- a/MagickCore/cache.c
+++ b/MagickCore/cache.c
@@ -3820,7 +3820,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
       ((MagickSizeType) image->rows > cache_info->height_limit))
     {
       (void) ThrowMagickException(exception,GetMagickModule(),ImageError,
-        "WidthOrHeightExceedsLimit","`%s' (%.20gx%.20g) > (%.20gx%.20g)",
+        "WidthOrHeightExceedsLimit","`%s' (%.17gx%.17g) > (%.17gx%.17g)",
         image->filename, (double) image->columns, (double) image->rows,
         (double) cache_info->width_limit,(double) cache_info->height_limit);
       return(MagickFalse);
@@ -3834,7 +3834,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
     }
   source_info=(*cache_info);
   source_info.file=(-1);
-  (void) FormatLocaleString(cache_info->filename,MagickPathExtent,"%s[%.20g]",
+  (void) FormatLocaleString(cache_info->filename,MagickPathExtent,"%s[%.17g]",
     image->filename,(double) image->scene);
   cache_info->storage_class=image->storage_class;
   cache_info->colorspace=image->colorspace;
@@ -3932,7 +3932,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
                   type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
                     cache_info->type);
                   (void) FormatLocaleString(message,MagickPathExtent,
-                    "open %s (%s %s, %.20gx%.20gx%.20g %s)",
+                    "open %s (%s %s, %.17gx%.17gx%.17g %s)",
                     cache_info->filename,cache_info->mapped != MagickFalse ?
                     "Anonymous" : "Heap",type,(double) cache_info->columns,
                     (double) cache_info->rows,(double)
@@ -4001,7 +4001,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
                   type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
                     cache_info->type);
                   (void) FormatLocaleString(message,MagickPathExtent,
-                    "open %s (%s[%d], %s, %.20gx%.20gx%.20g %s)",
+                    "open %s (%s[%d], %s, %.17gx%.17gx%.17g %s)",
                     cache_info->filename,cache_info->cache_filename,
                     GetDistributeCacheFile((DistributeCacheInfo *)
                     cache_info->server_info),type,(double) cache_info->columns,
@@ -4112,7 +4112,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
                   type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
                     cache_info->type);
                   (void) FormatLocaleString(message,MagickPathExtent,
-                    "open %s (%s[%d], %s, %.20gx%.20gx%.20g %s)",
+                    "open %s (%s[%d], %s, %.17gx%.17gx%.17g %s)",
                     cache_info->filename,cache_info->cache_filename,
                     cache_info->file,type,(double) cache_info->columns,
                     (double) cache_info->rows,(double)
@@ -4145,7 +4145,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
       type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
         cache_info->type);
       (void) FormatLocaleString(message,MagickPathExtent,
-        "open %s (%s[%d], %s, %.20gx%.20gx%.20g %s)",cache_info->filename,
+        "open %s (%s[%d], %s, %.17gx%.17gx%.17g %s)",cache_info->filename,
         cache_info->cache_filename,cache_info->file,type,(double)
         cache_info->columns,(double) cache_info->rows,(double)
         cache_info->number_channels,format);
@@ -4724,7 +4724,7 @@ static MagickBooleanType ReadPixelCacheMetacontent(
   if ((cache_info->debug != MagickFalse) &&
       (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse))
     (void) LogMagickEvent(CacheEvent,GetMagickModule(),
-      "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double)
+      "%s[%.17gx%.17g%+.20g%+.20g]",cache_info->filename,(double)
       nexus_info->region.width,(double) nexus_info->region.height,(double)
       nexus_info->region.x,(double) nexus_info->region.y);
   return(MagickTrue);
@@ -4902,7 +4902,7 @@ static MagickBooleanType ReadPixelCachePixels(
   if ((cache_info->debug != MagickFalse) &&
       (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse))
     (void) LogMagickEvent(CacheEvent,GetMagickModule(),
-      "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double)
+      "%s[%.17gx%.17g%+.20g%+.20g]",cache_info->filename,(double)
       nexus_info->region.width,(double) nexus_info->region.height,(double)
       nexus_info->region.x,(double) nexus_info->region.y);
   return(MagickTrue);
@@ -5905,7 +5905,7 @@ static MagickBooleanType WritePixelCacheMetacontent(CacheInfo *cache_info,
   if ((cache_info->debug != MagickFalse) &&
       (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse))
     (void) LogMagickEvent(CacheEvent,GetMagickModule(),
-      "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double)
+      "%s[%.17gx%.17g%+.20g%+.20g]",cache_info->filename,(double)
       nexus_info->region.width,(double) nexus_info->region.height,(double)
       nexus_info->region.x,(double) nexus_info->region.y);
   return(MagickTrue);
@@ -6075,7 +6075,7 @@ static MagickBooleanType WritePixelCachePixels(
   if ((cache_info->debug != MagickFalse) &&
       (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse))
     (void) LogMagickEvent(CacheEvent,GetMagickModule(),
-      "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double)
+      "%s[%.17gx%.17g%+.20g%+.20g]",cache_info->filename,(double)
       nexus_info->region.width,(double) nexus_info->region.height,(double)
       nexus_info->region.x,(double) nexus_info->region.y);
   return(MagickTrue);
diff --git a/MagickCore/compare.c b/MagickCore/compare.c
index a0b5c75b4..b6481bd4c 100644
--- a/MagickCore/compare.c
+++ b/MagickCore/compare.c
@@ -2078,7 +2078,7 @@ static MagickBooleanType GetSSIMSimularity(const Image *image,
   artifact=GetImageArtifact(image,"compare:ssim-sigma");
   if (artifact != (const char *) NULL)
     sigma=StringToDouble(artifact,(char **) NULL);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"gaussian:%.20gx%.20g",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"gaussian:%.17gx%.17g",
     radius,sigma);
   kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c
index 8c6b3a64d..dba326362 100644
--- a/MagickCore/delegate.c
+++ b/MagickCore/delegate.c
@@ -638,14 +638,14 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     {
       WarnNoImageReturn("\"%%%c\"",letter);
       (void) FormatLocaleString(value,MagickPathExtent,
-        "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+        "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,(double)
         image->page.height,(double) image->page.x,(double) image->page.y);
       break;
     }
     case 'h': /* Image height (current) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image->rows != 0 ? image->rows : image->magick_rows));
       break;
     }
@@ -664,7 +664,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'n': /* Number of images in the list.  */
     {
       if (image != (Image *) NULL)
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
           GetImageListLength(image));
       break;
     }
@@ -677,14 +677,14 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'p': /* Image index in current image list */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         GetImageIndexInList(image));
       break;
     }
     case 'q': /* Quantum depth of image in memory */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         MAGICKCORE_QUANTUM_DEPTH);
       break;
     }
@@ -705,7 +705,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 's': /* Image scene number */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->scene);
       break;
     }
@@ -724,14 +724,14 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'w': /* Image width (current) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image->columns != 0 ? image->columns : image->magick_columns));
       break;
     }
     case 'x': /* Image horizontal resolution (with units) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         fabs(image->resolution.x) > MagickEpsilon ? image->resolution.x :
         image->units == PixelsPerCentimeterResolution ? DefaultResolution/2.54 :
         DefaultResolution);
@@ -740,7 +740,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'y': /* Image vertical resolution (with units) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         fabs(image->resolution.y) > MagickEpsilon ? image->resolution.y :
         image->units == PixelsPerCentimeterResolution ? DefaultResolution/2.54 :
         DefaultResolution);
@@ -749,7 +749,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'z': /* Image depth as read in */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         (double) image->depth);
       break;
     }
@@ -786,21 +786,21 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'G': /* Image size as geometry = "%wx%h" */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17gx%.17g",
         (double) image->magick_columns,(double) image->magick_rows);
       break;
     }
     case 'H': /* layer canvas height */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         (double) image->page.height);
       break;
     }
     case 'I': /* image iterations for animations */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->iterations);
       break;
     }
@@ -820,28 +820,28 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'P': /* layer canvas page size = "%Wx%H" */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17gx%.17g",
         (double) image->page.width,(double) image->page.height);
       break;
     }
     case '~': /* BPG image compression quality */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (100-(image->quality == 0 ? 42 : image->quality))/2);
       break;
     }
     case 'Q': /* image compression quality */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image->quality == 0 ? 92 : image->quality));
       break;
     }
     case 'S': /* Number of scenes in image list.  */
     {
       WarnNoImageInfoReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image_info->number_scenes == 0 ? 2147483647 :
          image_info->number_scenes));
       break;
@@ -849,7 +849,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'T': /* image time delay for animations */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->delay);
       break;
     }
@@ -863,7 +863,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
     case 'W': /* layer canvas width */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->page.width);
       break;
     }
@@ -894,7 +894,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image,
       WarnNoImageReturn("\"%%%c\"",letter);
       page=GetImageBoundingBox(image,exception);
       (void) FormatLocaleString(value,MagickPathExtent,
-        "%.20gx%.20g%+.20g%+.20g",(double) page.width,(double) page.height,
+        "%.17gx%.17g%+.20g%+.20g",(double) page.width,(double) page.height,
         (double) page.x,(double) page.y);
       break;
     }
diff --git a/MagickCore/display.c b/MagickCore/display.c
index b9da02fb3..81a0143e0 100644
--- a/MagickCore/display.c
+++ b/MagickCore/display.c
@@ -3082,7 +3082,7 @@ static MagickBooleanType XChopImage(Display *display,
         if (windows->info.mapped == MagickFalse)
           (void) XMapWindow(display,windows->info.id);
         (void) FormatLocaleString(text,MagickPathExtent,
-          " %.20gx%.20g%+.20g%+.20g",(double) chop_info.width,(double)
+          " %.17gx%.17g%+.20g%+.20g",(double) chop_info.width,(double)
           chop_info.height,(double) chop_info.x,(double) chop_info.y);
         XInfoWidget(display,windows,text);
         XHighlightLine(display,windows->image.id,
@@ -4395,7 +4395,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   height=(unsigned int) windows->image.window_changes.height;
   if (resource_info->debug != MagickFalse)
     (void) LogMagickEvent(X11Event,GetMagickModule(),
-      "Configure Image: %dx%d=>%.20gx%.20g",windows->image.ximage->width,
+      "Configure Image: %dx%d=>%.17gx%.17g",windows->image.ximage->width,
       windows->image.ximage->height,(double) width,(double) height);
   if ((width*height) == 0)
     return(MagickTrue);
@@ -4853,7 +4853,7 @@ static MagickBooleanType XCropImage(Display *display,
           if (windows->info.mapped == MagickFalse)
             (void) XMapWindow(display,windows->info.id);
           (void) FormatLocaleString(text,MagickPathExtent,
-            " %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+            " %.17gx%.17g%+.20g%+.20g",(double) crop_info.width,(double)
             crop_info.height,(double) crop_info.x,(double) crop_info.y);
           XInfoWidget(display,windows,text);
           XHighlightRectangle(display,windows->image.id,
@@ -4946,7 +4946,7 @@ static MagickBooleanType XCropImage(Display *display,
             Display pointer position.
           */
           (void) FormatLocaleString(text,MagickPathExtent,
-            " %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+            " %.17gx%.17g%+.20g%+.20g",(double) crop_info.width,(double)
             crop_info.height,(double) crop_info.x,(double) crop_info.y);
           XInfoWidget(display,windows,text);
         }
@@ -5236,7 +5236,7 @@ static MagickBooleanType XCropImage(Display *display,
             Set primary selection.
           */
           (void) FormatLocaleString(text,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+            "%.17gx%.17g%+.20g%+.20g",(double) crop_info.width,(double)
             crop_info.height,(double) crop_info.x,(double) crop_info.y);
           request=(&(event.xselectionrequest));
           (void) XChangeProperty(request->display,request->requestor,
@@ -5953,7 +5953,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 Display info and draw drawing rectangle.
               */
               (void) FormatLocaleString(text,MagickPathExtent,
-                " %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
+                " %.17gx%.17g%+.20g%+.20g",(double) rectangle_info.width,
                 (double) rectangle_info.height,(double) rectangle_info.x,
                 (double) rectangle_info.y);
               XInfoWidget(display,windows,text);
@@ -5977,7 +5977,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 Display info and draw drawing rectangle.
               */
               (void) FormatLocaleString(text,MagickPathExtent,
-                " %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
+                " %.17gx%.17g%+.20g%+.20g",(double) rectangle_info.width,
                 (double) rectangle_info.height,(double) rectangle_info.x,
                 (double) rectangle_info.y);
               XInfoWidget(display,windows,text);
@@ -7392,7 +7392,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       height=(size_t) windows->image.ximage->height;
       x=0;
       y=0;
-      (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g+0+0",
+      (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g+0+0",
         (double) width,(double) height);
       status=XDialogWidget(display,windows,"Resize",
         "Enter resize geometry (e.g. 640x480, 200%):",geometry);
@@ -9084,7 +9084,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       preview=(PreviewType) ParseCommandOption(MagickPreviewOptions,
         MagickFalse,preview_type);
-      (void) FormatImageProperty(*image,"group","%.20g",(double)
+      (void) FormatImageProperty(*image,"group","%.17g",(double)
         windows->image.id);
       (void) DeleteImageProperty(*image,"label");
       (void) SetImageProperty(*image,"label","Preview",exception);
@@ -9115,7 +9115,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       (void) DeleteImageProperty(*image,"label");
-      (void) FormatImageProperty(*image,"group","%.20g",(double)
+      (void) FormatImageProperty(*image,"group","%.17g",(double)
         windows->image.id);
       (void) SetImageProperty(*image,"label","Histogram",exception);
       (void) AcquireUniqueFilename(filename);
@@ -9154,7 +9154,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) FormatImageProperty(*image,"group","%.20g",(double)
+      (void) FormatImageProperty(*image,"group","%.17g",(double)
         windows->image.id);
       (void) DeleteImageProperty(*image,"label");
       (void) SetImageProperty(*image,"label","Matte",exception);
@@ -11504,7 +11504,7 @@ static MagickBooleanType XROIImage(Display *display,
           if (windows->info.mapped == MagickFalse)
             (void) XMapWindow(display,windows->info.id);
           (void) FormatLocaleString(text,MagickPathExtent,
-            " %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
+            " %.17gx%.17g%+.20g%+.20g",(double) roi_info.width,(double)
             roi_info.height,(double) roi_info.x,(double) roi_info.y);
           XInfoWidget(display,windows,text);
           XHighlightRectangle(display,windows->image.id,
@@ -11602,7 +11602,7 @@ static MagickBooleanType XROIImage(Display *display,
             Display pointer position.
           */
           (void) FormatLocaleString(text,MagickPathExtent,
-            " %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
+            " %.17gx%.17g%+.20g%+.20g",(double) roi_info.width,(double)
             roi_info.height,(double) roi_info.x,(double) roi_info.y);
           XInfoWidget(display,windows,text);
         }
@@ -11949,7 +11949,7 @@ static MagickBooleanType XROIImage(Display *display,
             Set primary selection.
           */
           (void) FormatLocaleString(text,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
+            "%.17gx%.17g%+.20g%+.20g",(double) roi_info.width,(double)
             roi_info.height,(double) roi_info.x,(double) roi_info.y);
           request=(&(event.xselectionrequest));
           (void) XChangeProperty(request->display,request->requestor,
@@ -12606,7 +12606,7 @@ static MagickBooleanType XSaveImage(Display *display,
       /*
         Request JPEG quality from user.
       */
-      (void) FormatLocaleString(quality,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(quality,MagickPathExtent,"%.17g",(double)
         image->quality);
       status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
         quality);
@@ -13008,7 +13008,7 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
       /*
         Display info on cropping rectangle.
       */
-      (void) FormatLocaleString(text,MagickPathExtent," %.20gx%.20g%+.20g%+.20g",
+      (void) FormatLocaleString(text,MagickPathExtent," %.17gx%.17g%+.20g%+.20g",
         (double) crop_info->width,(double) crop_info->height,(double)
         crop_info->x,(double) crop_info->y);
       XInfoWidget(display,windows,text);
@@ -13980,10 +13980,10 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   if (resource_info->debug != MagickFalse)
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
-        "Image: %s[%.20g] %.20gx%.20g ",image->filename,(double) image->scene,
+        "Image: %s[%.17g] %.17gx%.17g ",image->filename,(double) image->scene,
         (double) image->columns,(double) image->rows);
       if (image->colors != 0)
-        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.17gc ",(double)
           image->colors);
       (void) LogMagickEvent(X11Event,GetMagickModule(),"%s",image->magick);
     }
@@ -14631,11 +14631,11 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   if (resource_info->debug != MagickFalse)
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
-        "Image: %s[%.20g] %.20gx%.20g ",display_image->filename,
+        "Image: %s[%.17g] %.17gx%.17g ",display_image->filename,
         (double) display_image->scene,(double) display_image->columns,
         (double) display_image->rows);
       if (display_image->colors != 0)
-        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+        (void) LogMagickEvent(X11Event,GetMagickModule(),"%.17gc ",(double)
           display_image->colors);
       (void) LogMagickEvent(X11Event,GetMagickModule(),"%s",
         display_image->magick);
@@ -14759,7 +14759,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
           MagickPackageName,filename);
       else
         (void) FormatLocaleString(window_name,MagickPathExtent,
-          "%s: %s[scene: %.20g frames: %.20g]",MagickPackageName,filename,
+          "%s: %s[scene: %.17g frames: %.17g]",MagickPackageName,filename,
           (double) display_image->scene,(double) GetImageListLength(
           display_image));
       (void) CloneString(&windows->image.name,window_name);
diff --git a/MagickCore/distort.c b/MagickCore/distort.c
index a63aa0aa9..bea412b31 100644
--- a/MagickCore/distort.c
+++ b/MagickCore/distort.c
@@ -443,7 +443,7 @@ static double *GenerateCoefficients(const Image *image,
           (((number_arguments-1) % cp_size) != 0))
         {
           (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-                 "InvalidArgument", "%s : 'require at least %.20g CPs'",
+                 "InvalidArgument", "%s : 'require at least %.17g CPs'",
                  "Polynomial", (double) i);
           return((double *) NULL);
         }
@@ -522,7 +522,7 @@ static double *GenerateCoefficients(const Image *image,
       if ( number_arguments%cp_size != 0 ||
            number_arguments < cp_size ) {
         (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-               "InvalidArgument", "%s : 'require at least %.20g CPs'",
+               "InvalidArgument", "%s : 'require at least %.17g CPs'",
                "Affine", 1.0);
         coeff=(double *) RelinquishMagickMemory(coeff);
         return((double *) NULL);
@@ -637,7 +637,7 @@ static double *GenerateCoefficients(const Image *image,
       if (((number_arguments % cp_size) != 0) || (number_arguments < cp_size))
         {
           (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-            "InvalidArgument", "%s : 'require at least %.20g CPs'",
+            "InvalidArgument", "%s : 'require at least %.17g CPs'",
             CommandOptionToMnemonic(MagickDistortOptions,*method),2.0);
           coeff=(double *) RelinquishMagickMemory(coeff);
           return((double *) NULL);
@@ -880,7 +880,7 @@ static double *GenerateCoefficients(const Image *image,
       if ( number_arguments%cp_size != 0 ||
            number_arguments < cp_size*4 ) {
         (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-              "InvalidArgument", "%s : 'require at least %.20g CPs'",
+              "InvalidArgument", "%s : 'require at least %.17g CPs'",
               CommandOptionToMnemonic(MagickDistortOptions, *method), 4.0);
         coeff=(double *) RelinquishMagickMemory(coeff);
         return((double *) NULL);
@@ -998,7 +998,7 @@ static double *GenerateCoefficients(const Image *image,
       if ( number_arguments%cp_size != 0 ||
            number_arguments < cp_size*4 ) {
         (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-              "InvalidArgument", "%s : 'require at least %.20g CPs'",
+              "InvalidArgument", "%s : 'require at least %.17g CPs'",
               CommandOptionToMnemonic(MagickDistortOptions, *method), 4.0);
         coeff=(double *) RelinquishMagickMemory(coeff);
         return((double *) NULL);
@@ -2072,7 +2072,7 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method,
     /* Set destination image size and virtual offset */
     if ( bestfit || viewport_given ) {
       (void) FormatLocaleString(image_gen,MagickPathExtent,
-        "  -size %.20gx%.20g -page %+.20g%+.20g xc: +insert \\\n",
+        "  -size %.17gx%.17g -page %+.20g%+.20g xc: +insert \\\n",
         (double) geometry.width,(double) geometry.height,(double) geometry.x,
         (double) geometry.y);
       lookup="v.p{xx-v.page.x-0.5,yy-v.page.y-0.5}";
@@ -2275,7 +2275,7 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method,
         (void) FormatLocaleFile(stderr,"Arc Distort, Internal Coefficients:\n");
         for (i=0; i < 5; i++)
           (void) FormatLocaleFile(stderr,
-            "  c%.20g = %+lf\n",(double) i,coeff[i]);
+            "  c%.17g = %+lf\n",(double) i,coeff[i]);
         (void) FormatLocaleFile(stderr,"Arc Distort, FX Equivalent:\n");
         (void) FormatLocaleFile(stderr,"%s", image_gen);
         (void) FormatLocaleFile(stderr,"  -fx 'ii=i+page.x; jj=j+page.y;\n");
@@ -2293,7 +2293,7 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method,
       {
         (void) FormatLocaleFile(stderr,"Polar Distort, Internal Coefficients\n");
         for (i=0; i < 8; i++)
-          (void) FormatLocaleFile(stderr,"  c%.20g = %+lf\n",(double) i,
+          (void) FormatLocaleFile(stderr,"  c%.17g = %+lf\n",(double) i,
             coeff[i]);
         (void) FormatLocaleFile(stderr,"Polar Distort, FX Equivalent:\n");
         (void) FormatLocaleFile(stderr,"%s", image_gen);
@@ -2314,7 +2314,7 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method,
         (void) FormatLocaleFile(stderr,
           "DePolar Distort, Internal Coefficients\n");
         for (i=0; i < 8; i++)
-          (void) FormatLocaleFile(stderr,"  c%.20g = %+lf\n",(double) i,
+          (void) FormatLocaleFile(stderr,"  c%.17g = %+lf\n",(double) i,
             coeff[i]);
         (void) FormatLocaleFile(stderr,"DePolar Distort, FX Equivalent:\n");
         (void) FormatLocaleFile(stderr,"%s", image_gen);
diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 8294e38d0..18e96b100 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -483,7 +483,7 @@ static void LogPolygonInfo(const PolygonInfo *polygon_info)
   p=polygon_info->edges;
   for (i=0; i < (ssize_t) polygon_info->number_edges; i++)
   {
-    (void) LogMagickEvent(DrawEvent,GetMagickModule(),"      edge %.20g:",
+    (void) LogMagickEvent(DrawEvent,GetMagickModule(),"      edge %.17g:",
       (double) i);
     (void) LogMagickEvent(DrawEvent,GetMagickModule(),"      direction: %s",
       p->direction != MagickFalse ? "down" : "up");
@@ -3647,7 +3647,7 @@ static MagickBooleanType RenderMVGContent(Image *image,
                 (void) FormatLocaleString(key,MagickPathExtent,"%s-geometry",
                   name);
                 (void) FormatLocaleString(geometry,MagickPathExtent,
-                  "%.20gx%.20g%+.20g%+.20g",(double) region.width,(double)
+                  "%.17gx%.17g%+.20g%+.20g",(double) region.width,(double)
                   region.height,(double) region.x,(double) region.y);
                 (void) SetImageArtifact(image,key,geometry);
                 (void) GetNextToken(q,&q,extent,token);
@@ -5386,34 +5386,34 @@ static void LogPrimitiveInfo(const PrimitiveInfo *primitive_info)
     case AlphaPrimitive:
     {
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "AlphaPrimitive %.20g,%.20g %s",(double) x,(double) y,
+        "AlphaPrimitive %.17g,%.17g %s",(double) x,(double) y,
         methods[primitive_info->method]);
       return;
     }
     case ColorPrimitive:
     {
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "ColorPrimitive %.20g,%.20g %s",(double) x,(double) y,
+        "ColorPrimitive %.17g,%.17g %s",(double) x,(double) y,
         methods[primitive_info->method]);
       return;
     }
     case ImagePrimitive:
     {
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "ImagePrimitive %.20g,%.20g",(double) x,(double) y);
+        "ImagePrimitive %.17g,%.17g",(double) x,(double) y);
       return;
     }
     case PointPrimitive:
     {
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "PointPrimitive %.20g,%.20g %s",(double) x,(double) y,
+        "PointPrimitive %.17g,%.17g %s",(double) x,(double) y,
         methods[primitive_info->method]);
       return;
     }
     case TextPrimitive:
     {
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "TextPrimitive %.20g,%.20g",(double) x,(double) y);
+        "TextPrimitive %.17g,%.17g",(double) x,(double) y);
       return;
     }
     default:
@@ -5430,27 +5430,27 @@ static void LogPrimitiveInfo(const PrimitiveInfo *primitive_info)
       {
         coordinates=(ssize_t) primitive_info[i].coordinates;
         (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-          "    begin open (%.20g)",(double) coordinates);
+          "    begin open (%.17g)",(double) coordinates);
         p=point;
       }
     point=primitive_info[i].point;
     if ((fabs(q.x-point.x) >= MagickEpsilon) ||
         (fabs(q.y-point.y) >= MagickEpsilon))
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "      %.20g: %.18g,%.18g",(double) coordinates,point.x,point.y);
+        "      %.17g: %.18g,%.18g",(double) coordinates,point.x,point.y);
     else
       (void) LogMagickEvent(DrawEvent,GetMagickModule(),
-        "      %.20g: %g %g (duplicate)",(double) coordinates,point.x,point.y);
+        "      %.17g: %g %g (duplicate)",(double) coordinates,point.x,point.y);
     q=point;
     coordinates--;
     if (coordinates > 0)
       continue;
     if ((fabs(p.x-point.x) >= MagickEpsilon) ||
         (fabs(p.y-point.y) >= MagickEpsilon))
-      (void) LogMagickEvent(DrawEvent,GetMagickModule(),"    end last (%.20g)",
+      (void) LogMagickEvent(DrawEvent,GetMagickModule(),"    end last (%.17g)",
         (double) coordinates);
     else
-      (void) LogMagickEvent(DrawEvent,GetMagickModule(),"    end open (%.20g)",
+      (void) LogMagickEvent(DrawEvent,GetMagickModule(),"    end open (%.17g)",
         (double) coordinates);
   }
 }
@@ -5805,7 +5805,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
       geometry.x=x;
       geometry.y=y;
       (void) FormatLocaleString(composite_geometry,MagickPathExtent,
-        "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,(double)
+        "%.17gx%.17g%+.20g%+.20g",(double) composite_image->columns,(double)
         composite_image->rows,(double) geometry.x,(double) geometry.y);
       (void) ParseGravityGeometry(image,composite_geometry,&geometry,exception);
       affine=draw_info->affine;
diff --git a/MagickCore/effect.c b/MagickCore/effect.c
index 9e9564723..5ad42cbcb 100644
--- a/MagickCore/effect.c
+++ b/MagickCore/effect.c
@@ -787,7 +787,7 @@ MagickExport Image *BlurImage(const Image *image,const double radius,
     return(blur_image);
 #endif
   (void) FormatLocaleString(geometry,MagickPathExtent,
-    "blur:%.20gx%.20g;blur:%.20gx%.20g+90",radius,sigma,radius,sigma);
+    "blur:%.17gx%.17g;blur:%.17gx%.17g+90",radius,sigma,radius,sigma);
   kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
@@ -1738,7 +1738,7 @@ MagickExport Image *GaussianBlurImage(const Image *image,const double radius,
   assert(exception->signature == MagickCoreSignature);
   if (IsEventLogging() != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"gaussian:%.20gx%.20g",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"gaussian:%.17gx%.17g",
     radius,sigma);
   kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
@@ -2766,7 +2766,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
         if (preview_image != (Image *) NULL)
           for (x=0; x < i; x++)
             (void) ContrastImage(preview_image,MagickTrue,exception);
-        (void) FormatLocaleString(label,MagickPathExtent,"contrast (%.20g)",
+        (void) FormatLocaleString(label,MagickPathExtent,"contrast (%.17g)",
           (double) i+1);
         break;
       }
@@ -2777,7 +2777,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
           break;
         for (x=0; x < i; x++)
           (void) ContrastImage(preview_image,MagickFalse,exception);
-        (void) FormatLocaleString(label,MagickPathExtent,"+contrast (%.20g)",
+        (void) FormatLocaleString(label,MagickPathExtent,"+contrast (%.17g)",
           (double) i+1);
         break;
       }
@@ -2791,7 +2791,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
         quantize_info.colorspace=GRAYColorspace;
         (void) QuantizeImage(&quantize_info,preview_image,exception);
         (void) FormatLocaleString(label,MagickPathExtent,
-          "-colorspace gray -colors %.20g",(double) colors);
+          "-colorspace gray -colors %.17g",(double) colors);
         break;
       }
       case QuantizePreview:
@@ -2802,7 +2802,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
         colors<<=1;
         quantize_info.number_colors=colors;
         (void) QuantizeImage(&quantize_info,preview_image,exception);
-        (void) FormatLocaleString(label,MagickPathExtent,"colors %.20g",
+        (void) FormatLocaleString(label,MagickPathExtent,"colors %.17g",
           (double) colors);
         break;
       }
@@ -2819,7 +2819,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
         preview_image=DespeckleImage(thumbnail,exception);
         if (preview_image == (Image *) NULL)
           break;
-        (void) FormatLocaleString(label,MagickPathExtent,"despeckle (%.20g)",
+        (void) FormatLocaleString(label,MagickPathExtent,"despeckle (%.17g)",
           (double) i+1);
         break;
       }
@@ -2948,7 +2948,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
         raise.y=(i-1)/2;
         (void) RaiseImage(preview_image,&raise,MagickTrue,exception);
         (void) FormatLocaleString(label,MagickPathExtent,
-          "raise %.20gx%.20g%+.20g%+.20g",(double) raise.width,(double)
+          "raise %.17gx%.17g%+.20g%+.20g",(double) raise.width,(double)
           raise.height,(double) raise.x,(double) raise.y);
         break;
       }
@@ -3020,7 +3020,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
         if (preview_image == (Image *) NULL)
           break;
         preview_info->quality=(size_t) percentage;
-        (void) FormatLocaleString(factor,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(factor,MagickPathExtent,"%.17g",(double)
           preview_info->quality);
         file=AcquireUniqueFileResource(filename);
         if (file != -1)
@@ -3054,7 +3054,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
               GetBlobSize(preview_image))/1024.0);
           else
             (void) FormatLocaleString(label,MagickPathExtent,
-              "quality %s\n%.20gb ",factor,(double) ((MagickOffsetType)
+              "quality %s\n%.17gb ",factor,(double) ((MagickOffsetType)
               GetBlobSize(thumbnail)));
         break;
       }
@@ -3493,14 +3493,14 @@ MagickExport Image *SelectiveBlurImage(const Image *image,const double radius,
         v;

       (void) LogMagickEvent(TransformEvent,GetMagickModule(),
-        "  SelectiveBlurImage with %.20gx%.20g kernel:",(double) width,(double)
+        "  SelectiveBlurImage with %.17gx%.17g kernel:",(double) width,(double)
         width);
       message=AcquireString("");
       k=kernel;
       for (v=0; v < (ssize_t) width; v++)
       {
         *message='\0';
-        (void) FormatLocaleString(format,MagickPathExtent,"%.20g: ",(double) v);
+        (void) FormatLocaleString(format,MagickPathExtent,"%.17g: ",(double) v);
         (void) ConcatenateString(&message,format);
         for (u=0; u < (ssize_t) width; u++)
         {
diff --git a/MagickCore/exception.c b/MagickCore/exception.c
index e622dca16..f8539c280 100644
--- a/MagickCore/exception.c
+++ b/MagickCore/exception.c
@@ -1134,7 +1134,7 @@ MagickExport MagickBooleanType ThrowMagickExceptionList(
     type="error";
   if (severity >= FatalErrorException)
     type="fatal";
-  (void) FormatLocaleString(message,MagickPathExtent,"%s @ %s/%s/%s/%.20g",
+  (void) FormatLocaleString(message,MagickPathExtent,"%s @ %s/%s/%s/%.17g",
     reason,type,path,function,(double) line);
   (void) ThrowException(exception,severity,message,(char *) NULL);
   return(status);
diff --git a/MagickCore/feature.c b/MagickCore/feature.c
index 1ac0c6816..d4529eb14 100644
--- a/MagickCore/feature.c
+++ b/MagickCore/feature.c
@@ -286,7 +286,7 @@ MagickExport Image *CannyEdgeImage(const Image *image,const double radius,
     Filter out noise.
   */
   (void) FormatLocaleString(geometry,MagickPathExtent,
-    "blur:%.20gx%.20g;blur:%.20gx%.20g+90",radius,sigma,radius,sigma);
+    "blur:%.17gx%.17g;blur:%.17gx%.17g+90",radius,sigma,radius,sigma);
   kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
@@ -1968,12 +1968,12 @@ MagickExport Image *HoughLineImage(const Image *image,const size_t width,
       return((Image *) NULL);
     }
   (void) FormatLocaleString(message,MagickPathExtent,
-    "# Hough line transform: %.20gx%.20g%+.20g\n",(double) width,
+    "# Hough line transform: %.17gx%.17g%+.20g\n",(double) width,
     (double) height,(double) threshold);
   if (write(file,message,strlen(message)) != (ssize_t) strlen(message))
     status=MagickFalse;
   (void) FormatLocaleString(message,MagickPathExtent,
-    "viewbox 0 0 %.20g %.20g\n",(double) image->columns,(double) image->rows);
+    "viewbox 0 0 %.17g %.17g\n",(double) image->columns,(double) image->rows);
   if (write(file,message,strlen(message)) != (ssize_t) strlen(message))
     status=MagickFalse;
   (void) FormatLocaleString(message,MagickPathExtent,
diff --git a/MagickCore/identify.c b/MagickCore/identify.c
index 71f612186..cdcb7f98a 100644
--- a/MagickCore/identify.c
+++ b/MagickCore/identify.c
@@ -336,7 +336,7 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image,
         {
           if ((locations != 0) && (n >= (ssize_t) locations))
             break;
-          (void) FormatLocaleFile(file," %.20g,%.20g",(double) x,(double) y);
+          (void) FormatLocaleFile(file," %.17g,%.17g",(double) x,(double) y);
           n++;
         }
       p+=(ptrdiff_t) GetPixelChannels(image);
@@ -377,7 +377,7 @@ static ssize_t PrintChannelMoments(FILE *file,const PixelChannel channel,
     channel_moments[channel].ellipse_intensity,GetMagickPrecision(),
     channel_moments[channel].ellipse_intensity);
   for (i=0; i < MaximumNumberOfImageMoments; i++)
-    n+=FormatLocaleFile(file,"      I%.20g: %.*g (%.*g)\n",i+1.0,
+    n+=FormatLocaleFile(file,"      I%.17g: %.*g (%.*g)\n",i+1.0,
       GetMagickPrecision(),channel_moments[channel].invariant[i]/pow(scale,
       powers[i]),GetMagickPrecision(),channel_moments[channel].invariant[i]);
   return(n);
@@ -419,13 +419,13 @@ static ssize_t PrintChannelPerceptualHash(Image *image,FILE *file,
     traits=GetPixelChannelTraits(image,channel);
     if (traits == UndefinedPixelTrait)
       continue;
-    n=FormatLocaleFile(file,"    Channel %.20g:\n",(double) channel);
+    n=FormatLocaleFile(file,"    Channel %.17g:\n",(double) channel);
     for (j=0; j < MaximumNumberOfPerceptualHashes; j++)
     {
       ssize_t
         k;

-      n+=FormatLocaleFile(file,"      PH%.20g: ",(double) j+1);
+      n+=FormatLocaleFile(file,"      PH%.17g: ",(double) j+1);
       for (k=0; k < (ssize_t) channel_phash[0].number_colorspaces; k++)
       {
         n+=FormatLocaleFile(file,"%.*g",GetMagickPrecision(),
@@ -642,22 +642,22 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
            (image->scene == 0))
         (void) FormatLocaleFile(file,"%s ",image->filename);
       else
-        (void) FormatLocaleFile(file,"%s[%.20g] ",image->filename,(double)
+        (void) FormatLocaleFile(file,"%s[%.17g] ",image->filename,(double)
           image->scene);
       (void) FormatLocaleFile(file,"%s ",image->magick);
       if ((image->magick_columns != 0) || (image->magick_rows != 0))
         if ((image->magick_columns != image->columns) ||
             (image->magick_rows != image->rows))
-          (void) FormatLocaleFile(file,"%.20gx%.20g=>",(double)
+          (void) FormatLocaleFile(file,"%.17gx%.17g=>",(double)
             image->magick_columns,(double) image->magick_rows);
-      (void) FormatLocaleFile(file,"%.20gx%.20g ",(double) image->columns,
+      (void) FormatLocaleFile(file,"%.17gx%.17g ",(double) image->columns,
         (double) image->rows);
       if ((image->page.width != 0) || (image->page.height != 0) ||
           (image->page.x != 0) || (image->page.y != 0))
-        (void) FormatLocaleFile(file,"%.20gx%.20g%+.20g%+.20g ",(double)
+        (void) FormatLocaleFile(file,"%.17gx%.17g%+.20g%+.20g ",(double)
           image->page.width,(double) image->page.height,(double) image->page.x,
           (double) image->page.y);
-      (void) FormatLocaleFile(file,"%.20g-bit ",(double) image->depth);
+      (void) FormatLocaleFile(file,"%.17g-bit ",(double) image->depth);
       if (image->type != UndefinedType)
         (void) FormatLocaleFile(file,"%s ",CommandOptionToMnemonic(
           MagickTypeOptions,(ssize_t) image->type));
@@ -675,13 +675,13 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         }
       else
         if (image->total_colors <= image->colors)
-          (void) FormatLocaleFile(file,"%.20gc ",(double)
+          (void) FormatLocaleFile(file,"%.17gc ",(double)
             image->colors);
         else
-          (void) FormatLocaleFile(file,"%.20g=>%.20gc ",(double)
+          (void) FormatLocaleFile(file,"%.17g=>%.17gc ",(double)
             image->total_colors,(double) image->colors);
       if (image->error.mean_error_per_pixel != 0.0)
-        (void) FormatLocaleFile(file,"%.20g/%f/%fdb ",(double)
+        (void) FormatLocaleFile(file,"%.17g/%f/%fdb ",(double)
           (image->error.mean_error_per_pixel+0.5),
           image->error.normalized_mean_error,
           image->error.normalized_maximum_error);
@@ -761,13 +761,13 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
     }
   (void) FormatLocaleFile(file,"  Class: %s\n",CommandOptionToMnemonic(
     MagickClassOptions,(ssize_t) image->storage_class));
-  (void) FormatLocaleFile(file,"  Geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+  (void) FormatLocaleFile(file,"  Geometry: %.17gx%.17g%+.20g%+.20g\n",(double)
     image->columns,(double) image->rows,(double) image->tile_offset.x,(double)
     image->tile_offset.y);
   if ((image->magick_columns != 0) || (image->magick_rows != 0))
     if ((image->magick_columns != image->columns) ||
         (image->magick_rows != image->rows))
-      (void) FormatLocaleFile(file,"  Base geometry: %.20gx%.20g\n",(double)
+      (void) FormatLocaleFile(file,"  Base geometry: %.17gx%.17g\n",(double)
         image->magick_columns,(double) image->magick_rows);
   if ((image->resolution.x != 0.0) && (image->resolution.y != 0.0))
     {
@@ -792,10 +792,10 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
   if (depth != 0)
     {
       if (image->depth == depth)
-        (void) FormatLocaleFile(file,"  Depth: %.20g-bit\n",(double)
+        (void) FormatLocaleFile(file,"  Depth: %.17g-bit\n",(double)
           image->depth);
       else
-        (void) FormatLocaleFile(file,"  Depth: %.20g/%.20g-bit\n",(double)
+        (void) FormatLocaleFile(file,"  Depth: %.17g/%.17g-bit\n",(double)
           image->depth,(double) depth);
     }
   (void) FormatLocaleFile(file,"  Channels: %g.%g\n",(double)
@@ -812,29 +812,29 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         case sRGBColorspace:
         {
           if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Red: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Red: %.17g-bit\n",(double)
               channel_statistics[RedPixelChannel].depth);
           if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Green: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Green: %.17g-bit\n",(double)
               channel_statistics[GreenPixelChannel].depth);
           if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Blue: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Blue: %.17g-bit\n",(double)
               channel_statistics[BluePixelChannel].depth);
           break;
         }
         case CMYKColorspace:
         {
           if ((GetPixelCyanTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Cyan: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Cyan: %.17g-bit\n",(double)
               channel_statistics[CyanPixelChannel].depth);
           if ((GetPixelMagentaTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Magenta: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Magenta: %.17g-bit\n",(double)
               channel_statistics[MagentaPixelChannel].depth);
           if ((GetPixelYellowTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Yellow: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Yellow: %.17g-bit\n",(double)
               channel_statistics[YellowPixelChannel].depth);
           if ((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Black: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Black: %.17g-bit\n",(double)
               channel_statistics[BlackPixelChannel].depth);
           break;
         }
@@ -842,7 +842,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         case GRAYColorspace:
         {
           if ((GetPixelGrayTraits(image) & UpdatePixelTrait) != 0)
-            (void) FormatLocaleFile(file,"    Gray: %.20g-bit\n",(double)
+            (void) FormatLocaleFile(file,"    Gray: %.17g-bit\n",(double)
               channel_statistics[GrayPixelChannel].depth);
           break;
         }
@@ -853,23 +853,23 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             PixelChannel channel = GetPixelChannelChannel(image,i);
             PixelTrait traits = GetPixelChannelTraits(image,channel);
             if ((traits & UpdatePixelTrait) != 0)
-              (void) FormatLocaleFile(file,"    Channel %.20g: %.20g-bit\n",
+              (void) FormatLocaleFile(file,"    Channel %.17g: %.17g-bit\n",
                 (double) i,(double) channel_statistics[channel].depth);
           }
           break;
         }
       }
       if (image->alpha_trait != UndefinedPixelTrait)
-        (void) FormatLocaleFile(file,"    Alpha: %.20g-bit\n",(double)
+        (void) FormatLocaleFile(file,"    Alpha: %.17g-bit\n",(double)
           channel_statistics[AlphaPixelChannel].depth);
       if ((image->channels & ReadMaskChannel) != 0)
-        (void) FormatLocaleFile(file,"    Read mask: %.20g-bit\n",(double)
+        (void) FormatLocaleFile(file,"    Read mask: %.17g-bit\n",(double)
           channel_statistics[ReadMaskPixelChannel].depth);
       if ((image->channels & WriteMaskChannel) != 0)
-        (void) FormatLocaleFile(file,"    Write mask: %.20g-bit\n",(double)
+        (void) FormatLocaleFile(file,"    Write mask: %.17g-bit\n",(double)
           channel_statistics[WriteMaskPixelChannel].depth);
       if ((image->channels & CompositeMaskChannel) != 0)
-        (void) FormatLocaleFile(file,"    Composite mask: %.20g-bit\n",
+        (void) FormatLocaleFile(file,"    Composite mask: %.17g-bit\n",
           (double) channel_statistics[CompositeMaskPixelChannel].depth);
       if (image->number_meta_channels != 0)
         for (i=0; i < (ssize_t) image->number_meta_channels; i++)
@@ -877,7 +877,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           PixelChannel
             channel = (PixelChannel) (MetaPixelChannels+i);

-          (void) FormatLocaleFile(file,"    Meta channel[%.20g]: %.20g-bit\n",
+          (void) FormatLocaleFile(file,"    Meta channel[%.17g]: %.17g-bit\n",
             (double) i,(double) channel_statistics[channel].depth);
         }
       scale=1.0;
@@ -885,7 +885,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         scale=(double) (QuantumRange/((size_t) QuantumRange >> ((size_t)
           MAGICKCORE_QUANTUM_DEPTH-image->depth)));
       (void) FormatLocaleFile(file,"  Channel statistics:\n");
-      (void) FormatLocaleFile(file,"    Pixels: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"    Pixels: %.17g\n",(double)
         image->columns*image->rows);
       switch (colorspace)
       {
@@ -939,7 +939,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             if ((traits & UpdatePixelTrait) != 0)
               {
                 (void) FormatLocaleString(label,MagickPathExtent,
-                  "Channel %.20g",(double) i);
+                  "Channel %.17g",(double) i);
                 (void) PrintChannelStatistics(file,channel,label,1.0/scale,
                   channel_statistics);
               }
@@ -969,7 +969,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             channel = (PixelChannel) (MetaPixelChannels+i);

           (void) FormatLocaleString(label,MagickPathExtent,
-            "Meta channel[%.20g]",(double) i);
+            "Meta channel[%.17g]",(double) i);
           (void) PrintChannelStatistics(file,channel,label,1.0/scale,
             channel_statistics);
         }
@@ -1038,7 +1038,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             if ((traits & UpdatePixelTrait) != 0)
               {
                 (void) FormatLocaleString(label,MagickPathExtent,
-                  "Channel %.20g",(double) i);
+                  "Channel %.17g",(double) i);
                 (void) PrintChannelMoments(file,channel,label,scale,
                   channel_moments);
               }
@@ -1119,7 +1119,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             if ((traits & UpdatePixelTrait) != 0)
               {
                 (void) FormatLocaleString(label,MagickPathExtent,
-                  "Channel %.20g",(double) i);
+                  "Channel %.17g",(double) i);
                 (void) PrintChannelFeatures(file,channel,label,
                   channel_features);
               }
@@ -1182,7 +1182,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         }
       if (IsHistogramImage(image,exception) != MagickFalse)
         {
-          (void) FormatLocaleFile(file,"  Colors: %.20g\n",(double)
+          (void) FormatLocaleFile(file,"  Colors: %.17g\n",(double)
             GetNumberColors(image,(FILE *) NULL,exception));
           (void) FormatLocaleFile(file,"  Histogram:\n");
           (void) GetNumberColors(image,file,exception);
@@ -1191,13 +1191,13 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         {
           artifact=GetImageArtifact(image,"identify:unique-colors");
           if (IsStringTrue(artifact) != MagickFalse)
-            (void) FormatLocaleFile(file,"  Colors: %.20g\n",(double)
+            (void) FormatLocaleFile(file,"  Colors: %.17g\n",(double)
               GetNumberColors(image,(FILE *) NULL,exception));
         }
     }
   if (image->storage_class == PseudoClass)
     {
-      (void) FormatLocaleFile(file,"  Colormap entries: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"  Colormap entries: %.17g\n",(double)
         image->colors);
       (void) FormatLocaleFile(file,"  Colormap:\n");
       if (image->colors <= 1024)
@@ -1285,7 +1285,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         image->chromaticity.white_point.z);
     }
   if ((image->extract_info.width*image->extract_info.height) != 0)
-    (void) FormatLocaleFile(file,"  Tile geometry: %.20gx%.20g%+.20g%+.20g\n",
+    (void) FormatLocaleFile(file,"  Tile geometry: %.17gx%.17g%+.20g%+.20g\n",
       (double) image->extract_info.width,(double) image->extract_info.height,
       (double) image->extract_info.x,(double) image->extract_info.y);
   (void) QueryColorname(image,&image->matte_color,SVGCompliance,color,
@@ -1308,7 +1308,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
     MagickComposeOptions,(ssize_t) image->compose));
   if ((image->page.width != 0) || (image->page.height != 0) ||
       (image->page.x != 0) || (image->page.y != 0))
-    (void) FormatLocaleFile(file,"  Page geometry: %.20gx%.20g%+.20g%+.20g\n",
+    (void) FormatLocaleFile(file,"  Page geometry: %.17gx%.17g%+.20g%+.20g\n",
       (double) image->page.width,(double) image->page.height,(double)
       image->page.x,(double) image->page.y);
   if ((image->page.x != 0) || (image->page.y != 0))
@@ -1317,24 +1317,24 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
   (void) FormatLocaleFile(file,"  Dispose: %s\n",CommandOptionToMnemonic(
     MagickDisposeOptions,(ssize_t) image->dispose));
   if (image->delay != 0)
-    (void) FormatLocaleFile(file,"  Delay: %.20gx%.20g\n",(double) image->delay,
+    (void) FormatLocaleFile(file,"  Delay: %.17gx%.17g\n",(double) image->delay,
       (double) image->ticks_per_second);
   if (image->iterations != 1)
-    (void) FormatLocaleFile(file,"  Iterations: %.20g\n",(double)
+    (void) FormatLocaleFile(file,"  Iterations: %.17g\n",(double)
       image->iterations);
   if (image->duration != 0)
-    (void) FormatLocaleFile(file,"  Duration: %.20g\n",(double)
+    (void) FormatLocaleFile(file,"  Duration: %.17g\n",(double)
       image->duration);
   if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
-    (void) FormatLocaleFile(file,"  Scene: %.20g of %.20g\n",(double)
+    (void) FormatLocaleFile(file,"  Scene: %.17g of %.17g\n",(double)
       image->scene,(double) GetImageListLength(image));
   else
     if (image->scene != 0)
-      (void) FormatLocaleFile(file,"  Scene: %.20g\n",(double) image->scene);
+      (void) FormatLocaleFile(file,"  Scene: %.17g\n",(double) image->scene);
   (void) FormatLocaleFile(file,"  Compression: %s\n",CommandOptionToMnemonic(
     MagickCompressOptions,(ssize_t) image->compression));
   if (image->quality != UndefinedCompressionQuality)
-    (void) FormatLocaleFile(file,"  Quality: %.20g\n",(double) image->quality);
+    (void) FormatLocaleFile(file,"  Quality: %.17g\n",(double) image->quality);
   (void) FormatLocaleFile(file,"  Orientation: %s\n",CommandOptionToMnemonic(
     MagickOrientationOptions,(ssize_t) image->orientation));
   if (image->montage != (char *) NULL)
@@ -1377,7 +1377,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             (void) FormatLocaleFile(file,"\n");
             continue;
           }
-        (void) FormatLocaleFile(file," %.20gx%.20g %s\n",(double)
+        (void) FormatLocaleFile(file," %.17gx%.17g %s\n",(double)
           tile->magick_columns,(double) tile->magick_rows,tile->magick);
         (void) SignatureImage(tile,exception);
         ResetImagePropertyIterator(tile);
@@ -1472,7 +1472,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         profile=GetImageProfile(image,name);
         if (profile == (StringInfo *) NULL)
           continue;
-        (void) FormatLocaleFile(file,"    Profile-%s: %.20g bytes\n",name,
+        (void) FormatLocaleFile(file,"    Profile-%s: %.17g bytes\n",name,
           (double) GetStringInfoLength(profile));
         if (LocaleCompare(name,"iptc") == 0)
           {
@@ -1561,7 +1561,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
                 case 219: tag="Custom Field 20"; break;
                 default: tag="unknown"; break;
               }
-              (void) FormatLocaleFile(file,"      %s[%.20g,%.20g]: ",tag,
+              (void) FormatLocaleFile(file,"      %s[%.17g,%.17g]: ",tag,
                 (double) dataset,(double) record);
               length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
               length|=GetStringInfoDatum(profile)[i++];
diff --git a/MagickCore/layer.c b/MagickCore/layer.c
index 3b9ad4d8c..52f15d438 100644
--- a/MagickCore/layer.c
+++ b/MagickCore/layer.c
@@ -1041,12 +1041,12 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
   */
 #if DEBUG_OPT_FRAME
   i=0;
-  (void) FormatLocaleFile(stderr,"frame %.20g :-\n",(double) i);
+  (void) FormatLocaleFile(stderr,"frame %.17g :-\n",(double) i);
 #endif
   disposals[0]=NoneDispose;
   bounds[0]=CompareImagesBounds(prev_image,curr,CompareAnyLayer,exception);
 #if DEBUG_OPT_FRAME
-  (void) FormatLocaleFile(stderr, "overlay: %.20gx%.20g%+.20g%+.20g\n\n",
+  (void) FormatLocaleFile(stderr, "overlay: %.17gx%.17g%+.20g%+.20g\n\n",
     (double) bounds[i].width,(double) bounds[i].height,
     (double) bounds[i].x,(double) bounds[i].y );
 #endif
@@ -1064,7 +1064,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
   for ( ; curr != (const Image *) NULL; curr=GetNextImageInList(curr))
   {
 #if DEBUG_OPT_FRAME
-    (void) FormatLocaleFile(stderr,"frame %.20g :-\n",(double) i);
+    (void) FormatLocaleFile(stderr,"frame %.17g :-\n",(double) i);
 #endif
     /*
       Assume none disposal is the best
@@ -1073,7 +1073,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
     cleared=IsBoundsCleared(curr->previous,curr,&bounds[i],exception);
     disposals[i-1]=NoneDispose;
 #if DEBUG_OPT_FRAME
-    (void) FormatLocaleFile(stderr, "overlay: %.20gx%.20g%+.20g%+.20g%s%s\n",
+    (void) FormatLocaleFile(stderr, "overlay: %.17gx%.17g%+.20g%+.20g%s%s\n",
          (double) bounds[i].width,(double) bounds[i].height,
          (double) bounds[i].x,(double) bounds[i].y,
          bounds[i].x < 0?"  (unchanged)":"",
@@ -1102,7 +1102,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
         try_bounds=CompareImagesBounds(prev_image,curr,CompareAnyLayer,exception);
         try_cleared=IsBoundsCleared(prev_image,curr,&try_bounds,exception);
 #if DEBUG_OPT_FRAME
-    (void) FormatLocaleFile(stderr, "test_prev: %.20gx%.20g%+.20g%+.20g%s\n",
+    (void) FormatLocaleFile(stderr, "test_prev: %.17gx%.17g%+.20g%+.20g%s\n",
          (double) try_bounds.width,(double) try_bounds.height,
          (double) try_bounds.x,(double) try_bounds.y,
          try_cleared?"  (pixels were cleared)":"");
@@ -1186,7 +1186,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
             */
             try_bounds=CompareImagesBounds(curr->previous,curr,CompareClearLayer,exception);
 #if DEBUG_OPT_FRAME
-            (void) FormatLocaleFile(stderr, "expand_clear: %.20gx%.20g%+.20g%+.20g%s\n",
+            (void) FormatLocaleFile(stderr, "expand_clear: %.17gx%.17g%+.20g%+.20g%s\n",
                 (double) try_bounds.width,(double) try_bounds.height,
                 (double) try_bounds.x,(double) try_bounds.y,
                 try_bounds.x<0?"  (no expand necessary)":"");
@@ -1196,7 +1196,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
             else
               {
 #if DEBUG_OPT_FRAME
-                (void) FormatLocaleFile(stderr, "expand_bgnd: %.20gx%.20g%+.20g%+.20g\n",
+                (void) FormatLocaleFile(stderr, "expand_bgnd: %.17gx%.17g%+.20g%+.20g\n",
                     (double) bgnd_bounds.width,(double) bgnd_bounds.height,
                     (double) bgnd_bounds.x,(double) bgnd_bounds.y );
 #endif
@@ -1231,7 +1231,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
                       bgnd_bounds.height = try_bounds.height;
                   }
 #if DEBUG_OPT_FRAME
-                (void) FormatLocaleFile(stderr, "        to : %.20gx%.20g%+.20g%+.20g\n",
+                (void) FormatLocaleFile(stderr, "        to : %.17gx%.17g%+.20g%+.20g\n",
                     (double) bgnd_bounds.width,(double) bgnd_bounds.height,
                     (double) bgnd_bounds.x,(double) bgnd_bounds.y );
 #endif
@@ -1246,12 +1246,12 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
  * Only CompareOverlay seemed to return something sensible.
  */
             try_bounds=CompareImagesBounds(bgnd_image,curr,CompareClearLayer,exception);
-            (void) FormatLocaleFile(stderr, "expand_ctst: %.20gx%.20g%+.20g%+.20g\n",
+            (void) FormatLocaleFile(stderr, "expand_ctst: %.17gx%.17g%+.20g%+.20g\n",
                 (double) try_bounds.width,(double) try_bounds.height,
                 (double) try_bounds.x,(double) try_bounds.y );
             try_bounds=CompareImagesBounds(bgnd_image,curr,CompareAnyLayer,exception);
             try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
-            (void) FormatLocaleFile(stderr, "expand_any : %.20gx%.20g%+.20g%+.20g%s\n",
+            (void) FormatLocaleFile(stderr, "expand_any : %.17gx%.17g%+.20g%+.20g%s\n",
                 (double) try_bounds.width,(double) try_bounds.height,
                 (double) try_bounds.x,(double) try_bounds.y,
                 try_cleared?"   (pixels cleared)":"");
@@ -1259,7 +1259,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
             try_bounds=CompareImagesBounds(bgnd_image,curr,CompareOverlayLayer,exception);
 #if DEBUG_OPT_FRAME
             try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
-            (void) FormatLocaleFile(stderr, "expand_test: %.20gx%.20g%+.20g%+.20g%s\n",
+            (void) FormatLocaleFile(stderr, "expand_test: %.17gx%.17g%+.20g%+.20g%s\n",
                 (double) try_bounds.width,(double) try_bounds.height,
                 (double) try_bounds.x,(double) try_bounds.y,
                 try_cleared?"   (pixels cleared)":"");
@@ -1330,14 +1330,14 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
     assert(prev_image != (Image *) NULL);
     disposals[i]=disposals[i-1];
 #if DEBUG_OPT_FRAME
-    (void) FormatLocaleFile(stderr, "final   %.20g : %s  %.20gx%.20g%+.20g%+.20g\n",
+    (void) FormatLocaleFile(stderr, "final   %.17g : %s  %.17gx%.17g%+.20g%+.20g\n",
          (double) i-1,
          CommandOptionToMnemonic(MagickDisposeOptions,disposals[i-1]),
          (double) bounds[i-1].width,(double) bounds[i-1].height,
          (double) bounds[i-1].x,(double) bounds[i-1].y );
 #endif
 #if DEBUG_OPT_FRAME
-    (void) FormatLocaleFile(stderr, "interim %.20g : %s  %.20gx%.20g%+.20g%+.20g\n",
+    (void) FormatLocaleFile(stderr, "interim %.17g : %s  %.17gx%.17g%+.20g%+.20g\n",
          (double) i,
          CommandOptionToMnemonic(MagickDisposeOptions,disposals[i]),
          (double) bounds[i].width,(double) bounds[i].height,
diff --git a/MagickCore/log.c b/MagickCore/log.c
index df9e6922b..9aaac861b 100644
--- a/MagickCore/log.c
+++ b/MagickCore/log.c
@@ -1295,7 +1295,7 @@ static void FormatLogFilename(const LogInfo *log_info,const ssize_t generation,
             q++;
             break;
           }
-        q+=(ptrdiff_t) FormatLocaleString(q,MagickPathExtent,"%.20g",(double)
+        q+=(ptrdiff_t) FormatLocaleString(q,MagickPathExtent,"%.17g",(double)
           (generation % log_info->generations));
         break;
       }
@@ -1306,7 +1306,7 @@ static void FormatLogFilename(const LogInfo *log_info,const ssize_t generation,
       }
       case 'p':
       {
-        q+=(ptrdiff_t) FormatLocaleString(q,MagickPathExtent,"%.20g",(double)
+        q+=(ptrdiff_t) FormatLocaleString(q,MagickPathExtent,"%.17g",(double)
           getpid());
         break;
       }
@@ -1386,11 +1386,11 @@ static char *TranslateEvent(const char *module,const char *function,
         "  <timestamp>%s</timestamp>\n"
         "  <elapsed-time>%lu:%02lu.%06lu</elapsed-time>\n"
         "  <user-time>%0.3f</user-time>\n"
-        "  <process-id>%.20g</process-id>\n"
-        "  <thread-id>%.20g</thread-id>\n"
+        "  <process-id>%.17g</process-id>\n"
+        "  <thread-id>%.17g</thread-id>\n"
         "  <module>%s</module>\n"
         "  <function>%s</function>\n"
-        "  <line>%.20g</line>\n"
+        "  <line>%.17g</line>\n"
         "  <domain>%s</domain>\n"
         "  <event>%s</event>\n"
         "</entry>",timestamp,(unsigned long) (elapsed_time/60.0),
@@ -1479,13 +1479,13 @@ static char *TranslateEvent(const char *module,const char *function,
       }
       case 'i':
       {
-        q+=(ptrdiff_t) FormatLocaleString(q,extent-(q-text),"%.20g",(double)
+        q+=(ptrdiff_t) FormatLocaleString(q,extent-(q-text),"%.17g",(double)
           GetMagickThreadSignature());
         break;
       }
       case 'l':
       {
-        q+=(ptrdiff_t) FormatLocaleString(q,extent-(q-text),"%.20g",(double)
+        q+=(ptrdiff_t) FormatLocaleString(q,extent-(q-text),"%.17g",(double)
           line);
         break;
       }
@@ -1510,7 +1510,7 @@ static char *TranslateEvent(const char *module,const char *function,
       }
       case 'p':
       {
-        q+=(ptrdiff_t) FormatLocaleString(q,extent-(q-text),"%.20g",(double)
+        q+=(ptrdiff_t) FormatLocaleString(q,extent-(q-text),"%.17g",(double)
           getpid());
         break;
       }
diff --git a/MagickCore/montage.c b/MagickCore/montage.c
index 2282783b1..03e459cdc 100644
--- a/MagickCore/montage.c
+++ b/MagickCore/montage.c
@@ -654,7 +654,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
         &sans,&sans);
     y_offset+=(ssize_t) title_offset;
     (void) FormatLocaleString(montage->montage,MagickPathExtent,
-      "%.20gx%.20g%+.20g%+.20g",(double) ((ssize_t) extract_info.width+
+      "%.17gx%.17g%+.20g%+.20g",(double) ((ssize_t) extract_info.width+
       (extract_info.x+(ssize_t) border_width)*2),(double) ((ssize_t)
       extract_info.height+(extract_info.y+(ssize_t) border_width)*2+(double)
       ((metrics.ascent-metrics.descent+4)*number_lines+
@@ -694,7 +694,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
         (void) GetTypeMetrics(image_list[0],draw_clone_info,&tile_metrics,
           exception);
         (void) FormatLocaleString(tile_geometry,MagickPathExtent,
-          "%.20gx%.20g%+.20g%+.20g",(double) montage->columns,(double)
+          "%.17gx%.17g%+.20g%+.20g",(double) montage->columns,(double)
           (tile_metrics.ascent-tile_metrics.descent),0.0,
           (double) extract_info.y+4);
         (void) CloneString(&draw_clone_info->geometry,tile_geometry);
@@ -771,7 +771,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
       if (image->gravity != UndefinedGravity)
         tile_image->gravity=image->gravity;
       (void) FormatLocaleString(tile_geometry,MagickPathExtent,
-        "%.20gx%.20g+0+0",(double) image->columns,(double) image->rows);
+        "%.17gx%.17g+0+0",(double) image->columns,(double) image->rows);
       flags=ParseGravityGeometry(tile_image,tile_geometry,&geometry,exception);
       x=geometry.x+(ssize_t) border_width;
       y=geometry.y+(ssize_t) border_width;
@@ -835,7 +835,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
                 Annotate composite tile with label.
               */
               (void) FormatLocaleString(tile_geometry,MagickPathExtent,
-                "%.20gx%.20g%+.20g%+.20g",(double) ((montage_info->frame ?
+                "%.17gx%.17g%+.20g%+.20g",(double) ((montage_info->frame ?
                 image->columns : width)-2*border_width),(double)
                 (metrics.ascent-metrics.descent+4)*MultilineCensus(value),
                 (double) (x_offset+(ssize_t) border_width),(double)
diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c
index 6fdee5709..3a626fcc5 100644
--- a/MagickCore/morphology.c
+++ b/MagickCore/morphology.c
@@ -3730,7 +3730,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,

       if (verbose != MagickFalse)
         (void) (void) FormatLocaleFile(stderr,
-          "%s:%.20g.%.20g #%.20g => Changed %.20g\n",
+          "%s:%.17g.%.17g #%.17g => Changed %.17g\n",
           CommandOptionToMnemonic(MagickMorphologyOptions, method),
           1.0,0.0,1.0, (double) changed);

@@ -3878,11 +3878,11 @@ MagickPrivate Image *MorphologyApply(const Image *image,
         /* Extra information for debugging compound operations */
         if (verbose != MagickFalse) {
           if ( stage_limit > 1 )
-            (void) FormatLocaleString(v_info,MagickPathExtent,"%s:%.20g.%.20g -> ",
+            (void) FormatLocaleString(v_info,MagickPathExtent,"%s:%.17g.%.17g -> ",
              CommandOptionToMnemonic(MagickMorphologyOptions,method),(double)
              method_loop,(double) stage_loop);
           else if ( primitive != method )
-            (void) FormatLocaleString(v_info, MagickPathExtent, "%s:%.20g -> ",
+            (void) FormatLocaleString(v_info, MagickPathExtent, "%s:%.17g -> ",
               CommandOptionToMnemonic(MagickMorphologyOptions, method),(double)
               method_loop);
           else
@@ -3914,7 +3914,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
             if ( kernel_loop > 1 )
               (void) FormatLocaleFile(stderr, "\n"); /* add end-of-line from previous */
             (void) (void) FormatLocaleFile(stderr,
-              "%s%s%s:%.20g.%.20g #%.20g => Changed %.20g",
+              "%s%s%s:%.17g.%.17g #%.17g => Changed %.17g",
               v_info,CommandOptionToMnemonic(MagickMorphologyOptions,
               primitive),(this_kernel == rflt_kernel ) ? "*" : "",
               (double) (method_loop+kernel_loop-1),(double) kernel_number,
@@ -3936,7 +3936,7 @@ MagickPrivate Image *MorphologyApply(const Image *image,
         } /* End Loop 4: Iterate the kernel with primitive */

         if (verbose != MagickFalse && kernel_changed != (size_t)changed)
-          (void) FormatLocaleFile(stderr, "   Total %.20g",(double) kernel_changed);
+          (void) FormatLocaleFile(stderr, "   Total %.17g",(double) kernel_changed);
         if (verbose != MagickFalse && stage_loop < stage_limit)
           (void) FormatLocaleFile(stderr, "\n"); /* add end-of-line before looping */

diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c
index 0407b1c6b..80a6431ae 100644
--- a/MagickCore/opencl.c
+++ b/MagickCore/opencl.c
@@ -1404,7 +1404,7 @@ static MagickBooleanType CompileOpenCLKernel(MagickCLDevice device,
     ptr++;
   }
   (void) FormatLocaleString(filename,MagickPathExtent,
-    "%s%s%s_%s_%08x_%.20g.bin",GetOpenCLCacheDirectory(),
+    "%s%s%s_%s_%08x_%.17g.bin",GetOpenCLCacheDirectory(),
     DirectorySeparator,"magick_opencl",deviceName,(unsigned int) signature,
     (double) sizeof(char*)*8);
   loaded=LoadCachedOpenCLKernels(device,filename);
diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c
index 04f3f738f..d0d502dca 100644
--- a/MagickCore/pixel.c
+++ b/MagickCore/pixel.c
@@ -6286,7 +6286,7 @@ static void LogPixelChannels(const Image *image)
     }
     if (image->colorspace ==  UndefinedColorspace)
       {
-        (void) FormatLocaleString(channel_name,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(channel_name,MagickPathExtent,"%.17g",
           (double) channel);
         name=(const char *) channel_name;
       }
@@ -6300,7 +6300,7 @@ static void LogPixelChannels(const Image *image)
     if (*traits == '\0')
       (void) ConcatenateMagickString(traits,"undefined,",MagickPathExtent);
     traits[strlen(traits)-1]='\0';
-    (void) LogMagickEvent(PixelEvent,GetMagickModule(),"  %.20g: %s (%s)",
+    (void) LogMagickEvent(PixelEvent,GetMagickModule(),"  %.17g: %s (%s)",
       (double) i,name,traits);
   }
 }
diff --git a/MagickCore/property.c b/MagickCore/property.c
index ff68acf13..5b601af25 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -1546,7 +1546,7 @@ static void GetEXIFProperty(const Image *image,const char *property,
             }
             case EXIF_FMT_SBYTE:
             {
-              EXIFMultipleValues("%.20g",(double) (*(signed char *) p));
+              EXIFMultipleValues("%.17g",(double) (*(signed char *) p));
               break;
             }
             case EXIF_FMT_SSHORT:
@@ -1561,13 +1561,13 @@ static void GetEXIFProperty(const Image *image,const char *property,
             }
             case EXIF_FMT_ULONG:
             {
-              EXIFMultipleValues("%.20g",(double)
+              EXIFMultipleValues("%.17g",(double)
                 ReadPropertyUnsignedLong(endian,p));
               break;
             }
             case EXIF_FMT_SLONG:
             {
-              EXIFMultipleValues("%.20g",(double)
+              EXIFMultipleValues("%.17g",(double)
                 ReadPropertySignedLong(endian,p));
               break;
             }
@@ -1579,7 +1579,7 @@ static void GetEXIFProperty(const Image *image,const char *property,
                   if (number_bytes < 24)
                     break;  /* reads three rationals */
                   components=1;
-                  EXIFGPSFractions("%.20g/%.20g,%.20g/%.20g,%.20g/%.20g",
+                  EXIFGPSFractions("%.17g/%.17g,%.17g/%.17g,%.17g/%.17g",
                     (double) ReadPropertyUnsignedLong(endian,p),
                     (double) ReadPropertyUnsignedLong(endian,p+4),
                     (double) ReadPropertyUnsignedLong(endian,p+8),
@@ -1588,27 +1588,27 @@ static void GetEXIFProperty(const Image *image,const char *property,
                     (double) ReadPropertyUnsignedLong(endian,p+20));
                   break;
                 }
-              EXIFMultipleFractions("%.20g/%.20g",(double)
+              EXIFMultipleFractions("%.17g/%.17g",(double)
                 ReadPropertyUnsignedLong(endian,p),(double)
                 ReadPropertyUnsignedLong(endian,p+4));
               break;
             }
             case EXIF_FMT_SRATIONAL:
             {
-              EXIFMultipleFractions("%.20g/%.20g",(double)
+              EXIFMultipleFractions("%.17g/%.17g",(double)
                 ReadPropertySignedLong(endian,p),(double)
                 ReadPropertySignedLong(endian,p+4));
               break;
             }
             case EXIF_FMT_SINGLE:
             {
-              EXIFMultipleValues("%.20g",(double)
+              EXIFMultipleValues("%.17g",(double)
                 ReadPropertySignedLong(endian,p));
               break;
             }
             case EXIF_FMT_DOUBLE:
             {
-              EXIFMultipleValues("%.20g",(double)
+              EXIFMultipleValues("%.17g",(double)
                 ReadPropertySignedLong(endian,p));
               break;
             }
@@ -2195,7 +2195,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
   (void) FormatLocaleString(message,MagickPathExtent,(
     "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
     "<svg xmlns=\"http://www.w3.org/2000/svg\""
-    " width=\"%.20g\" height=\"%.20g\">\n"
+    " width=\"%.17g\" height=\"%.17g\">\n"
     "<g>\n"
     "<path fill-rule=\"evenodd\" style=\"fill:#000000;stroke:#000000;"
     "stroke-width:0;shape-rendering:crispEdges\" d=\"\n"),(double) columns,
@@ -2571,14 +2571,14 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     {
       WarnNoImageReturn("\"%%%c\"",letter);
       (void) FormatLocaleString(value,MagickPathExtent,
-        "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+        "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,(double)
         image->page.height,(double) image->page.x,(double) image->page.y);
       break;
     }
     case 'h': /* Image height (current) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image->rows != 0 ? image->rows : image->magick_rows));
       break;
     }
@@ -2594,7 +2594,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
         FUTURE: ensure this does not generate the formatted comment!
       */
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         GetNumberColors(image,(FILE *) NULL,exception));
       break;
     }
@@ -2615,7 +2615,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'n': /* Number of images in the list.  */
     {
       if ( image != (Image *) NULL )
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
           GetImageListLength(image));
       else
         string="0";    /* no images or scenes */
@@ -2630,14 +2630,14 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'p': /* Image index in current image list */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         GetImageIndexInList(image));
       break;
     }
     case 'q': /* Quantum depth of image in memory */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         MAGICKCORE_QUANTUM_DEPTH);
       break;
     }
@@ -2659,16 +2659,16 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     {
 #if 0  /* this seems non-sensical -- simplifying */
       if (image_info->number_scenes != 0)
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
           image_info->scene);
       else if (image != (Image *) NULL)
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
           image->scene);
       else
           string="0";
 #else
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->scene);
 #endif
       break;
@@ -2690,14 +2690,14 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'w': /* Image width (current) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image->columns != 0 ? image->columns : image->magick_columns));
       break;
     }
     case 'x': /* Image horizontal resolution (with units) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         fabs(image->resolution.x) > MagickEpsilon ? image->resolution.x :
         image->units == PixelsPerCentimeterResolution ? DefaultResolution/2.54 :
         DefaultResolution);
@@ -2706,7 +2706,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'y': /* Image vertical resolution (with units) */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         fabs(image->resolution.y) > MagickEpsilon ? image->resolution.y :
         image->units == PixelsPerCentimeterResolution ? DefaultResolution/2.54 :
         DefaultResolution);
@@ -2715,7 +2715,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'z': /* Image depth as read in */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->depth);
       break;
     }
@@ -2729,10 +2729,10 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'B':  /* image size read in - in bytes */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->extent);
       if (image->extent == 0)
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
           GetBlobSize(image));
       break;
     }
@@ -2753,14 +2753,14 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'G': /* Image size as geometry = "%wx%h" */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17gx%.17g",(double)
         image->magick_columns,(double) image->magick_rows);
       break;
     }
     case 'H': /* layer canvas height */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->page.height);
       break;
     }
@@ -2773,7 +2773,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'N': /* Number of images in the list.  */
     {
       if ((image != (Image *) NULL) && (image->next == (Image *) NULL))
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g\n",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g\n",(double)
           GetImageListLength(image));
       else
         string="";
@@ -2789,14 +2789,14 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'P': /* layer canvas page size = "%Wx%H" */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17gx%.17g",(double)
         image->page.width,(double) image->page.height);
       break;
     }
     case 'Q': /* image compression quality */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image->quality == 0 ? 92 : image->quality));
       break;
     }
@@ -2807,12 +2807,12 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
       if (image_info->number_scenes == 0)
          string="2147483647";
       else if ( image != (Image *) NULL )
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
                 image_info->scene+image_info->number_scenes);
       else
         string="0";
 #else
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         (image_info->number_scenes == 0 ? 2147483647 :
          image_info->number_scenes));
 #endif
@@ -2821,7 +2821,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'T': /* image time delay for animations */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->delay);
       break;
     }
@@ -2835,7 +2835,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'W': /* layer canvas width */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         image->page.width);
       break;
     }
@@ -2866,7 +2866,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
       WarnNoImageReturn("\"%%%c\"",letter);
       page=GetImageBoundingBox(image,exception);
       (void) FormatLocaleString(value,MagickPathExtent,
-        "%.20gx%.20g%+.20g%+.20g",(double) page.width,(double) page.height,
+        "%.17gx%.17g%+.20g%+.20g",(double) page.width,(double) page.height,
         (double) page.x,(double)page.y);
       break;
     }
@@ -2940,7 +2940,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("bit-depth",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
             GetImageDepth(image,exception));
           break;
         }
@@ -2976,7 +2976,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
           image->colors=GetNumberColors(image,(FILE *) NULL,exception);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
             image->colors);
           break;
         }
@@ -3135,7 +3135,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("depth",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
             image->depth);
           break;
         }
@@ -3188,7 +3188,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("height",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
             image->magick_rows != 0 ? (double) image->magick_rows : 256.0);
           break;
         }
@@ -3360,7 +3360,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("page",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g",
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17gx%.17g",
             (double) image->page.width,(double) image->page.height);
           break;
         }
@@ -3378,7 +3378,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
                 page = { 0, 0, 0, 0 };

               (void) ParseAbsoluteGeometry(papersize,&page);
-              (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g",
+              (void) FormatLocaleString(value,MagickPathExtent,"%.17gx%.17g",
                 (double) page.width,(double) page.height);
               papersize=DestroyString(papersize);
             }
@@ -3460,7 +3460,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("quality",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
             image->quality);
           break;
         }
@@ -3490,11 +3490,11 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
         {
           WarnNoImageInfoReturn("\"%%[%s]\"",property);
           if (image_info->number_scenes != 0)
-            (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+            (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
               image_info->scene);
           else {
             WarnNoImageReturn("\"%%[%s]\"",property);
-            (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+            (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
               image->scene);
           }
           break;
@@ -3503,7 +3503,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
         {
           /* FUTURE: equivalent to %n? */
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
             GetImageListLength(image));
           break;
         }
@@ -3582,7 +3582,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("width",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
             (image->magick_columns != 0 ? image->magick_columns : 256));
           break;
         }
diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c
index d0b5b9878..8172d2bad 100644
--- a/MagickCore/quantize.c
+++ b/MagickCore/quantize.c
@@ -2763,7 +2763,7 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
     }
     if (image->debug != MagickFalse)
       (void) LogMagickEvent(ImageEvent,GetMagickModule(),
-        "distortion[%.20g]: %*g %*g\n",(double) n,GetMagickPrecision(),
+        "distortion[%.17g]: %*g %*g\n",(double) n,GetMagickPrecision(),
         distortion,GetMagickPrecision(),fabs(distortion-previous_tolerance));
     if (fabs(distortion-previous_tolerance) <= tolerance)
       break;
@@ -2784,7 +2784,7 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
     for (n=0; n < (ssize_t) image->colors; n++)
     {
       GetColorTuple(image->colormap+n,MagickTrue,tuple);
-      (void) FormatLocaleFile(stderr,"%s %.20g\n",tuple,(double)
+      (void) FormatLocaleFile(stderr,"%s %.17g\n",tuple,(double)
         image->colormap[n].count);
     }
   dominant_image=CloneImage(image,0,0,MagickTrue,exception);
diff --git a/MagickCore/resize.c b/MagickCore/resize.c
index 551d90fa2..e1d1149d3 100644
--- a/MagickCore/resize.c
+++ b/MagickCore/resize.c
@@ -3879,7 +3879,7 @@ MagickExport Image *ResizeImage(const Image *image,const size_t columns,
       transform[MagickPathExtent];

     (void) FormatLocaleString(transform,MagickPathExtent,
-      "resize %.20gx%.20g %.20gx%.20g",(double) image->columns,
+      "resize %.17gx%.17g %.17gx%.17g",(double) image->columns,
       (double) image->rows,(double) resize_image->columns,
       (double) resize_image->rows);
     AppendImageProfileProperty(resize_image,"hdrgm","hdrgm:Transform",
@@ -4681,9 +4681,9 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns,
     (void) FormatImageProperty(thumbnail_image,"Thumb::URI","file://%s",
       encode_uri);
   if (GetPathAttributes(image->filename,&attributes) != MagickFalse )
-    (void) FormatImageProperty(thumbnail_image,"Thumb::MTime","%.20g",(double)
+    (void) FormatImageProperty(thumbnail_image,"Thumb::MTime","%.17g",(double)
       attributes.st_mtime);
-  (void) FormatImageProperty(thumbnail_image,"Thumb::Size","%.20g",
+  (void) FormatImageProperty(thumbnail_image,"Thumb::Size","%.17g",
     (double) GetBlobSize(image));
   mime_type=GetImageProperty(image,"mime:type",exception);
   if (mime_type != (const char *) NULL)
@@ -4691,11 +4691,11 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns,
       exception);
   (void) SetImageProperty(thumbnail_image,"software",MagickAuthoritativeURL,
     exception);
-  (void) FormatImageProperty(thumbnail_image,"Thumb::Image::Width","%.20g",
+  (void) FormatImageProperty(thumbnail_image,"Thumb::Image::Width","%.17g",
     (double) image->magick_columns);
-  (void) FormatImageProperty(thumbnail_image,"Thumb::Image::Height","%.20g",
+  (void) FormatImageProperty(thumbnail_image,"Thumb::Image::Height","%.17g",
     (double) image->magick_rows);
-  (void) FormatImageProperty(thumbnail_image,"Thumb::Document::Pages","%.20g",
+  (void) FormatImageProperty(thumbnail_image,"Thumb::Document::Pages","%.17g",
     (double) GetImageListLength(image));
   return(thumbnail_image);
 }
diff --git a/MagickCore/resource.c b/MagickCore/resource.c
index b0502173e..405e6fa80 100644
--- a/MagickCore/resource.c
+++ b/MagickCore/resource.c
@@ -962,11 +962,11 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file,
   (void) FormatLocaleFile(file,"  Memory: %s\n",memory_limit);
   (void) FormatLocaleFile(file,"  Map: %s\n",map_limit);
   (void) FormatLocaleFile(file,"  Disk: %s\n",disk_limit);
-  (void) FormatLocaleFile(file,"  File: %.20g\n",(double) ((MagickOffsetType)
+  (void) FormatLocaleFile(file,"  File: %.17g\n",(double) ((MagickOffsetType)
     resource_info.file_limit));
-  (void) FormatLocaleFile(file,"  Thread: %.20g\n",(double) ((MagickOffsetType)
+  (void) FormatLocaleFile(file,"  Thread: %.17g\n",(double) ((MagickOffsetType)
     resource_info.thread_limit));
-  (void) FormatLocaleFile(file,"  Throttle: %.20g\n",(double)
+  (void) FormatLocaleFile(file,"  Throttle: %.17g\n",(double)
     ((MagickOffsetType) resource_info.throttle_limit));
   (void) FormatLocaleFile(file,"  Time: %s\n",time_limit);
   (void) fflush(file);
diff --git a/MagickCore/segment.c b/MagickCore/segment.c
index b6346be2f..09462db21 100644
--- a/MagickCore/segment.c
+++ b/MagickCore/segment.c
@@ -467,7 +467,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
         cluster_threshold);
       (void) FormatLocaleFile(stdout,"\tWeighting Exponent = %g\n",(double)
         weighting_exponent);
-      (void) FormatLocaleFile(stdout,"\tTotal Number of Clusters = %.20g\n\n",
+      (void) FormatLocaleFile(stdout,"\tTotal Number of Clusters = %.17g\n\n",
         (double) number_clusters);
       /*
         Print the total number of points per cluster.
@@ -475,7 +475,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
       (void) FormatLocaleFile(stdout,"\n\nNumber of Vectors Per Cluster\n");
       (void) FormatLocaleFile(stdout,"=============================\n\n");
       for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
-        (void) FormatLocaleFile(stdout,"Cluster #%.20g = %.20g\n",(double)
+        (void) FormatLocaleFile(stdout,"Cluster #%.17g = %.17g\n",(double)
           cluster->id,(double) cluster->count);
       /*
         Print the cluster extents.
@@ -485,10 +485,10 @@ static MagickBooleanType Classify(Image *image,short **extrema,
       (void) FormatLocaleFile(stdout,"================");
       for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
       {
-        (void) FormatLocaleFile(stdout,"\n\nCluster #%.20g\n\n",(double)
+        (void) FormatLocaleFile(stdout,"\n\nCluster #%.17g\n\n",(double)
           cluster->id);
         (void) FormatLocaleFile(stdout,
-          "%.20g-%.20g  %.20g-%.20g  %.20g-%.20g\n",(double)
+          "%.17g-%.17g  %.17g-%.17g  %.17g-%.17g\n",(double)
           cluster->red.left,(double) cluster->red.right,(double)
           cluster->green.left,(double) cluster->green.right,(double)
           cluster->blue.left,(double) cluster->blue.right);
@@ -501,7 +501,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
       (void) FormatLocaleFile(stdout,"=====================");
       for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
       {
-        (void) FormatLocaleFile(stdout,"\n\nCluster #%.20g\n\n",(double)
+        (void) FormatLocaleFile(stdout,"\n\nCluster #%.17g\n\n",(double)
           cluster->id);
         (void) FormatLocaleFile(stdout,"%g  %g  %g\n",(double)
           cluster->red.center,(double) cluster->green.center,(double)
diff --git a/MagickCore/shear.c b/MagickCore/shear.c
index b54650bb1..bdd8ff42b 100644
--- a/MagickCore/shear.c
+++ b/MagickCore/shear.c
@@ -627,7 +627,7 @@ MagickExport Image *DeskewImage(const Image *image,const double threshold,
     char
       angle[MagickPathExtent];

-    (void) FormatLocaleString(angle,MagickPathExtent,"%.20g",degrees);
+    (void) FormatLocaleString(angle,MagickPathExtent,"%.17g",degrees);
     (void) SetImageArtifact(clone_image,"deskew:angle",angle);
   }
   (void) SetImageVirtualPixelMethod(clone_image,BackgroundVirtualPixelMethod,
@@ -664,7 +664,7 @@ MagickExport Image *DeskewImage(const Image *image,const double threshold,
   median_image=DestroyImage(median_image);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TransformEvent,GetMagickModule(),"  Deskew geometry: "
-      "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+      "%.17gx%.17g%+.20g%+.20g",(double) geometry.width,(double)
       geometry.height,(double) geometry.x,(double) geometry.y);
   crop_image=CropImage(deskew_image,&geometry,exception);
   deskew_image=DestroyImage(deskew_image);
@@ -1097,7 +1097,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations,
         transform[MagickPathExtent];

       (void) FormatLocaleString(transform,MagickPathExtent,
-        "rotate %.20gx%.20g %.20g",(double) image->columns,
+        "rotate %.17gx%.17g %.17g",(double) image->columns,
         (double) image->rows,(double) rotations);
       AppendImageProfileProperty(rotate_image,"hdrgm","hdrgm:Transform",
         transform,exception);
diff --git a/MagickCore/string.c b/MagickCore/string.c
index 2db50bea2..85c303b54 100644
--- a/MagickCore/string.c
+++ b/MagickCore/string.c
@@ -1112,9 +1112,9 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
   if (strstr(format,"e+") == (char *) NULL)
     {
       if (suffix == (const char *) NULL)
-        count=FormatLocaleString(format,length,"%.20g%s",extent,units[0]);
+        count=FormatLocaleString(format,length,"%.17g%s",extent,units[0]);
       else
-        count=FormatLocaleString(format,length,"%.20g%s%s",extent,units[0],
+        count=FormatLocaleString(format,length,"%.17g%s%s",extent,units[0],
           suffix);
       return(count);
     }
@@ -1506,7 +1506,7 @@ MagickExport void PrintStringInfo(FILE *file,const char *id,
   for (i=0; i < string_info->length; i++)
     if ((p[i] < 32) && (isspace((int)p[i]) == 0))
       break;
-  (void) FormatLocaleFile(file,"%s(%.20g):\n",id,(double) string_info->length);
+  (void) FormatLocaleFile(file,"%s(%.17g):\n",id,(double) string_info->length);
   if (i == string_info->length)
    {
      for (i = 0; i < string_info->length; i++)
diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c
index 2aa4083c1..7049894a4 100644
--- a/MagickCore/threshold.c
+++ b/MagickCore/threshold.c
@@ -1677,7 +1677,7 @@ static ThresholdMap *GetThresholdMapFile(const char *xml,const char *filename,
     if ((map->levels[i] < 0) || (map->levels[i] > map->divisor))
       {
         (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-          "XmlInvalidContent", "<level> %.20g out of range, map \"%s\"",
+          "XmlInvalidContent", "<level> %.17g out of range, map \"%s\"",
           (double) map->levels[i],map_id);
         thresholds=DestroyXMLTree(thresholds);
         map=DestroyThresholdMap(map);
diff --git a/MagickCore/transform.c b/MagickCore/transform.c
index 4f23a1ac8..5e47edbe9 100644
--- a/MagickCore/transform.c
+++ b/MagickCore/transform.c
@@ -597,7 +597,7 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry,
         Crop is not within virtual canvas, return 1 pixel transparent image.
       */
       (void) ThrowMagickException(exception,GetMagickModule(),OptionWarning,
-        "GeometryDoesNotContainImage","(\"%.20gx%.20g%+.20g%+.20g\") `%s'",
+        "GeometryDoesNotContainImage","(\"%.17gx%.17g%+.20g%+.20g\") `%s'",
         (double) geometry->width,(double) geometry->height,
         (double) geometry->x,(double) geometry->y,image->filename);
       crop_image=CloneImage(image,1,1,MagickTrue,exception);
@@ -748,7 +748,7 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry,
         transform[MagickPathExtent];

       (void) FormatLocaleString(transform,MagickPathExtent,
-        "crop %.20gx%.20g %.20gx%.20g%+.20g%+.20g",
+        "crop %.17gx%.17g %.17gx%.17g%+.20g%+.20g",
         (double) image->columns,(double) image->rows,(double) page.width,
         (double) page.height,(double) page.x,(double) page.y);
       AppendImageProfileProperty(crop_image,"hdrgm","hdrgm:Transform",
@@ -1311,7 +1311,7 @@ MagickExport Image *FlipImage(const Image *image,ExceptionInfo *exception)
         transform[MagickPathExtent];

       (void) FormatLocaleString(transform,MagickPathExtent,
-        "flip %.20gx%.20g",(double) image->columns,(double) image->rows);
+        "flip %.17gx%.17g",(double) image->columns,(double) image->rows);
       AppendImageProfileProperty(flip_image,"hdrgm","hdrgm:Transform",
         transform,exception);
     }
@@ -1457,7 +1457,7 @@ MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception)
         transform[MagickPathExtent];

       (void) FormatLocaleString(transform,MagickPathExtent,
-        "flop %.20gx%.20g",(double) image->columns,(double) image->rows);
+        "flop %.17gx%.17g",(double) image->columns,(double) image->rows);
       AppendImageProfileProperty(flop_image,"hdrgm","hdrgm:Transform",
         transform,exception);
     }
@@ -2269,7 +2269,7 @@ MagickExport Image *TransposeImage(const Image *image,ExceptionInfo *exception)
         transform[MagickPathExtent];

       (void) FormatLocaleString(transform,MagickPathExtent,
-        "transpose %.20gx%.20g",(double) image->columns,
+        "transpose %.17gx%.17g",(double) image->columns,
         (double) image->rows);
       AppendImageProfileProperty(transpose_image,"hdrgm","hdrgm:Transform",
         transform,exception);
@@ -2426,7 +2426,7 @@ MagickExport Image *TransverseImage(const Image *image,ExceptionInfo *exception)
         transform[MagickPathExtent];

       (void) FormatLocaleString(transform,MagickPathExtent,
-        "transverse %.20gx%.20g",(double) image->columns,
+        "transverse %.17gx%.17g",(double) image->columns,
         (double) image->rows);
       AppendImageProfileProperty(transverse_image,"hdrgm","hdrgm:Transform",
         transform,exception);
diff --git a/MagickCore/type.c b/MagickCore/type.c
index 8ae6348e0..57a281aea 100644
--- a/MagickCore/type.c
+++ b/MagickCore/type.c
@@ -988,7 +988,7 @@ MagickExport MagickBooleanType ListTypeInfo(FILE *file,ExceptionInfo *exception)
     (void) FormatLocaleFile(file,"    family: %s\n",family);
     (void) FormatLocaleFile(file,"    style: %s\n",style);
     (void) FormatLocaleFile(file,"    stretch: %s\n",stretch);
-    (void) FormatLocaleFile(file,"    weight: %.20g\n",(double)
+    (void) FormatLocaleFile(file,"    weight: %.17g\n",(double)
       type_info[i]->weight);
     (void) FormatLocaleFile(file,"    metrics: %s\n",metrics);
     (void) FormatLocaleFile(file,"    glyphs: %s\n",glyphs);
diff --git a/MagickCore/utility.c b/MagickCore/utility.c
index 50c632bea..cb3252256 100644
--- a/MagickCore/utility.c
+++ b/MagickCore/utility.c
@@ -1049,12 +1049,12 @@ MagickPrivate MagickBooleanType GetExecutionPath(char *path,const size_t extent)
     ssize_t
       count;

-    (void) FormatLocaleString(link_path,MagickPathExtent,"/proc/%.20g/exe",
+    (void) FormatLocaleString(link_path,MagickPathExtent,"/proc/%.17g/exe",
       (double) getpid());
     count=readlink(link_path,execution_path,PATH_MAX);
     if (count == -1)
       {
-        (void) FormatLocaleString(link_path,MagickPathExtent,"/proc/%.20g/file",
+        (void) FormatLocaleString(link_path,MagickPathExtent,"/proc/%.17g/file",
           (double) getpid());
         count=readlink(link_path,execution_path,PATH_MAX);
       }
diff --git a/MagickCore/vision.c b/MagickCore/vision.c
index 76bd67e43..b03baf73e 100644
--- a/MagickCore/vision.c
+++ b/MagickCore/vision.c
@@ -1654,9 +1654,9 @@ MagickExport Image *ConnectedComponentsImage(const Image *image,
                 artifact=GetImageArtifact(image,
                   "connected-components:exclude-ids");
                 if (IsStringTrue(artifact) == MagickFalse)
-                  (void) fprintf(stdout,"%.20g: ",(double) object[i].id);
+                  (void) fprintf(stdout,"%.17g: ",(double) object[i].id);
                 (void) fprintf(stdout,
-                  "%.20gx%.20g%+.20g%+.20g %.1f,%.1f %.*g %s",(double)
+                  "%.17gx%.17g%+.20g%+.20g %.1f,%.1f %.*g %s",(double)
                   object[i].bounding_box.width,(double)
                   object[i].bounding_box.height,(double)
                   object[i].bounding_box.x,(double) object[i].bounding_box.y,
diff --git a/MagickCore/visual-effects.c b/MagickCore/visual-effects.c
index cacb7d644..df99de7e7 100644
--- a/MagickCore/visual-effects.c
+++ b/MagickCore/visual-effects.c
@@ -787,7 +787,7 @@ MagickExport Image *ColorMatrixImage(const Image *image,
       for (v=0; v < 6; v++)
       {
         *message='\0';
-        (void) FormatLocaleString(format,MagickPathExtent,"%.20g: ",(double) v);
+        (void) FormatLocaleString(format,MagickPathExtent,"%.17g: ",(double) v);
         (void) ConcatenateString(&message,format);
         for (u=0; u < 6; u++)
         {
@@ -1755,7 +1755,7 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info,
               caption_image->background_color=image->border_color;
               (void) SetImageBackgroundColor(caption_image,exception);
               (void) CloneString(&annotate_info->text,text);
-              (void) FormatLocaleString(geometry,MagickPathExtent,"+0+%.20g",
+              (void) FormatLocaleString(geometry,MagickPathExtent,"+0+%.17g",
                 metrics.ascent);
               if (annotate_info->gravity == UndefinedGravity)
                 (void) CloneString(&annotate_info->geometry,AcquireString(
diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c
index a11bd0ce7..cedc097c8 100644
--- a/MagickCore/xwindow.c
+++ b/MagickCore/xwindow.c
@@ -2051,9 +2051,9 @@ MagickPrivate void XDisplayImageInfo(Display *display,
     undo_image=GetPreviousImageInList(undo_image);
   }
   (void) FormatLocaleFile(file,"Undo Edit Cache\n  levels: %u\n",levels);
-  (void) FormatLocaleFile(file,"  bytes: %.20gmb\n",(double)
+  (void) FormatLocaleFile(file,"  bytes: %.17gmb\n",(double)
     ((bytes+(1 << 19)) >> 20));
-  (void) FormatLocaleFile(file,"  limit: %.20gmb\n\n",(double)
+  (void) FormatLocaleFile(file,"  limit: %.17gmb\n\n",(double)
     resource_info->undo_cache);
   /*
     Write info about the image to a file.
@@ -5933,7 +5933,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
         resource_info->image_info->texture != (char *) NULL ?
         resource_info->image_info->texture : "pattern:checkerboard",
         MagickPathExtent);
-      (void) FormatLocaleString(size,MagickPathExtent,"%.20gx%.20g",(double)
+      (void) FormatLocaleString(size,MagickPathExtent,"%.17gx%.17g",(double)
         image->columns,(double) image->rows);
       image_info->size=ConstantString(size);
       pattern=ReadImage(image_info,exception);
@@ -6551,7 +6551,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info,
         resource_info->image_info->texture != (char *) NULL ?
         resource_info->image_info->texture : "pattern:checkerboard",
         MagickPathExtent);
-      (void) FormatLocaleString(size,MagickPathExtent,"%.20gx%.20g",(double)
+      (void) FormatLocaleString(size,MagickPathExtent,"%.17gx%.17g",(double)
         image->columns,(double) image->rows);
       image_info->size=ConstantString(size);
       pattern=ReadImage(image_info,exception);
@@ -7193,7 +7193,7 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows,
       while ((1 << i) <= (int) magnify)
         i++;
       (void) FormatLocaleString(windows->magnify.name,MagickPathExtent,
-        "Magnify %.20gX",(double) i);
+        "Magnify %.17gX",(double) i);
       status=XStringListToTextProperty(&windows->magnify.name,1,&window_name);
       if (status != False)
         {
@@ -9184,7 +9184,7 @@ MagickPrivate MagickBooleanType XRenderImage(Image *image,
           atan2(draw_info->affine.rx,draw_info->affine.sx);
     }
   (void) FormatLocaleString(annotate_info.geometry,MagickPathExtent,
-    "%.20gx%.20g%+.20g%+.20g",(double) width,(double) height,
+    "%.17gx%.17g%+.20g%+.20g",(double) width,(double) height,
     ceil(offset->x-0.5),ceil(offset->y-metrics->ascent-metrics->descent+
     draw_info->interline_spacing-0.5));
   pixel.pen_color.red=ScaleQuantumToShort(
@@ -9614,7 +9614,7 @@ MagickPrivate void XUserPreferences(XResourceInfo *resource_info)
   value=resource_info->gamma_correct ? "True" : "False";
   XrmPutStringResource(&preferences_database,specifier,(char *) value);
   (void) FormatLocaleString(specifier,MagickPathExtent,"%s.undoCache",client_name);
-  (void) FormatLocaleString(cache,MagickPathExtent,"%.20g",(double)
+  (void) FormatLocaleString(cache,MagickPathExtent,"%.17g",(double)
     resource_info->undo_cache);
   XrmPutStringResource(&preferences_database,specifier,cache);
   (void) FormatLocaleString(specifier,MagickPathExtent,"%s.usePixmap",client_name);
diff --git a/MagickWand/compare.c b/MagickWand/compare.c
index 4cc3f5d49..b3a209ac2 100644
--- a/MagickWand/compare.c
+++ b/MagickWand/compare.c
@@ -1345,7 +1345,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
             }
           }
           if (subimage_search != MagickFalse)
-            (void) FormatLocaleFile(stderr," @ %.20g,%.20g [%.*g]",
+            (void) FormatLocaleFile(stderr," @ %.17g,%.17g [%.*g]",
               (double) offset.x,(double) offset.y,GetMagickPrecision(),
               similarity_metric);
         }
@@ -1359,7 +1359,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
           (void) FormatLocaleFile(stderr,"Image: %s\n",image->filename);
           if ((reconstruct_image->columns != image->columns) ||
               (reconstruct_image->rows != image->rows))
-            (void) FormatLocaleFile(stderr,"Offset: %.20g,%.20g\n",(double)
+            (void) FormatLocaleFile(stderr,"Offset: %.17g,%.17g\n",(double)
               difference_image->page.x,(double) difference_image->page.y);
           (void) FormatLocaleFile(stderr,"  Channel distortion: %s\n",
             CommandOptionToMnemonic(MagickMetricOptions,(ssize_t) metric));
@@ -1579,7 +1579,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
             channel_distortion);
           if (subimage_search != MagickFalse)
             {
-              (void) FormatLocaleFile(stderr,"   Offset: %.20g,%.20g\n",
+              (void) FormatLocaleFile(stderr,"   Offset: %.17g,%.17g\n",
                 (double) difference_image->page.x,(double)
                 difference_image->page.y);
               (void) FormatLocaleFile(stderr,"   Similarity metric: %*g\n",
diff --git a/MagickWand/drawing-wand.c b/MagickWand/drawing-wand.c
index 6bf260c81..049be80a3 100644
--- a/MagickWand/drawing-wand.c
+++ b/MagickWand/drawing-wand.c
@@ -297,7 +297,7 @@ static void MVGAppendPointsCommand(DrawingWand *wand,const char *command,
   (void) MVGPrintf(wand,"%s",command);
   for (i=number_coordinates, coordinate=coordinates; i != 0; i--)
   {
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g",coordinate->x,coordinate->y);
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g",coordinate->x,coordinate->y);
     coordinate++;
   }
   (void) MVGPrintf(wand, "\n");
@@ -482,7 +482,7 @@ WandExport DrawingWand *CloneDrawingWand(const DrawingWand *wand)
   (void) memset(clone_wand,0,sizeof(*clone_wand));
   clone_wand->id=AcquireWandId();
   (void) FormatLocaleString(clone_wand->name,MagickPathExtent,
-    "DrawingWand-%.20g",(double) clone_wand->id);
+    "DrawingWand-%.17g",(double) clone_wand->id);
   clone_wand->exception=AcquireExceptionInfo();
   InheritException(clone_wand->exception,wand->exception);
   clone_wand->mvg=AcquireString(wand->mvg);
@@ -599,7 +599,7 @@ WandExport void DrawAffine(DrawingWand *wand,const AffineMatrix *affine)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   assert(affine != (const AffineMatrix *) NULL);
   AdjustAffine(wand,affine);
-  (void) MVGPrintf(wand,"affine %.20g %.20g %.20g %.20g %.20g %.20g\n",
+  (void) MVGPrintf(wand,"affine %.17g %.17g %.17g %.17g %.17g %.17g\n",
     affine->sx,affine->ry,affine->rx,affine->sy,affine->tx,affine->ty);
 }

@@ -647,7 +647,7 @@ WandExport void DrawAlpha(DrawingWand *wand,const double x,const double y,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"alpha %.20g %.20g '%s'\n",x,y,CommandOptionToMnemonic(
+  (void) MVGPrintf(wand,"alpha %.17g %.17g '%s'\n",x,y,CommandOptionToMnemonic(
     MagickMethodOptions,(ssize_t) paint_method));
 }

@@ -694,7 +694,7 @@ WandExport void DrawAnnotation(DrawingWand *wand,const double x,const double y,
   escaped_text=EscapeString((const char *) text,'\'');
   if (escaped_text != (char *) NULL)
     {
-      (void) MVGPrintf(wand,"text %.20g %.20g '%s'\n",x,y,escaped_text);
+      (void) MVGPrintf(wand,"text %.17g %.17g '%s'\n",x,y,escaped_text);
       escaped_text=DestroyString(escaped_text);
     }
 }
@@ -742,7 +742,7 @@ WandExport void DrawArc(DrawingWand *wand,const double sx,const double sy,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"arc %.20g %.20g %.20g %.20g %.20g %.20g\n",sx,sy,ex,
+  (void) MVGPrintf(wand,"arc %.17g %.17g %.17g %.17g %.17g %.17g\n",sx,sy,ex,
     ey,sd,ed);
 }

@@ -822,7 +822,7 @@ WandExport void DrawCircle(DrawingWand *wand,const double ox,const double oy,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"circle %.20g %.20g %.20g %.20g\n",ox,oy,px,py);
+  (void) MVGPrintf(wand,"circle %.17g %.17g %.17g %.17g\n",ox,oy,px,py);
 }

 /*
@@ -931,7 +931,7 @@ WandExport void DrawColor(DrawingWand *wand, const double x, const double y,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name);
-  (void) MVGPrintf(wand, "color %.20g %.20g '%s'\n",x,y,CommandOptionToMnemonic(
+  (void) MVGPrintf(wand, "color %.17g %.17g '%s'\n",x,y,CommandOptionToMnemonic(
     MagickMethodOptions,(ssize_t) paint_method));
 }

@@ -1035,7 +1035,7 @@ WandExport MagickBooleanType DrawComposite(DrawingWand *wand,
       char
         buffer[MagickPathExtent];

-      (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g bytes",(double)
+      (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g bytes",(double)
         (4L*blob_length/3L+4L));
       ThrowDrawException(ResourceLimitWarning,"MemoryAllocationFailed",
         wand->name);
@@ -1043,7 +1043,7 @@ WandExport MagickBooleanType DrawComposite(DrawingWand *wand,
     }
   mode=CommandOptionToMnemonic(MagickComposeOptions,(ssize_t) compose);
   media_type=MagickToMime(image->magick);
-  (void) MVGPrintf(wand,"image %s %.20g %.20g %.20g %.20g 'data:%s;base64,\n",
+  (void) MVGPrintf(wand,"image %s %.17g %.17g %.17g %.17g 'data:%s;base64,\n",
     mode,x,y,width,height,media_type);
   p=base64;
   for (i=(ssize_t) encoded_length; i > 0; i-=76)
@@ -1130,7 +1130,7 @@ WandExport void DrawEllipse(DrawingWand *wand,const double ox,const double oy,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"ellipse %.20g %.20g %.20g %.20g %.20g %.20g\n",ox,oy,
+  (void) MVGPrintf(wand,"ellipse %.17g %.17g %.17g %.17g %.17g %.17g\n",ox,oy,
     rx,ry,start,end);
 }

@@ -2567,7 +2567,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   child=AddChildToXMLTree(xml_info,"fill-opacity",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         (double) (QuantumScale*CurrentContext->fill.alpha));
       (void) SetXMLTreeContent(child,value);
     }
@@ -2588,7 +2588,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   child=AddChildToXMLTree(xml_info,"font-size",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         CurrentContext->pointsize);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2610,7 +2610,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   child=AddChildToXMLTree(xml_info,"font-weight",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         CurrentContext->weight);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2651,7 +2651,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
       {
         if (i != 0)
           (void) ConcatenateString(&dash_pattern,",");
-        (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
           CurrentContext->dash_pattern[i]);
         (void) ConcatenateString(&dash_pattern,value);
       }
@@ -2661,7 +2661,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   child=AddChildToXMLTree(xml_info,"stroke-dashoffset",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         CurrentContext->dash_offset);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2684,21 +2684,21 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   child=AddChildToXMLTree(xml_info,"stroke-miterlimit",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
         CurrentContext->miterlimit);
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"stroke-opacity",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         (double) (QuantumScale*CurrentContext->stroke.alpha));
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"stroke-width",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+      (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
         CurrentContext->stroke_width);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2810,7 +2810,7 @@ WandExport void DrawLine(DrawingWand *wand,const double sx,const double sy,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"line %.20g %.20g %.20g %.20g\n",sx,sy,ex,ey);
+  (void) MVGPrintf(wand,"line %.17g %.17g %.17g %.17g\n",sx,sy,ex,ey);
 }

 /*
@@ -2902,11 +2902,11 @@ static void DrawPathCurveTo(DrawingWand *wand,const PathMode mode,
     {
       wand->path_operation=PathCurveToOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand, "%c%.20g %.20g %.20g %.20g %.20g %.20g",
+      (void) MVGAutoWrapPrintf(wand, "%c%.17g %.17g %.17g %.17g %.17g %.17g",
         mode == AbsolutePathMode ? 'C' : 'c',x1,y1,x2,y2,x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g %.20g %.20g %.20g %.20g",x1,y1,
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g %.17g %.17g %.17g %.17g",x1,y1,
       x2,y2,x,y);
 }

@@ -3017,11 +3017,11 @@ static void DrawPathCurveToQuadraticBezier(DrawingWand *wand,
     {
       wand->path_operation=PathCurveToQuadraticBezierOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand, "%c%.20g %.20g %.20g %.20g",
+      (void) MVGAutoWrapPrintf(wand, "%c%.17g %.17g %.17g %.17g",
          mode == AbsolutePathMode ? 'Q' : 'q',x1,y1,x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g %.20g %.20g",x1,y1,x,y);
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g %.17g %.17g",x1,y1,x,y);
 }

 WandExport void DrawPathCurveToQuadraticBezierAbsolute(DrawingWand *wand,
@@ -3129,11 +3129,11 @@ static void DrawPathCurveToQuadraticBezierSmooth(DrawingWand *wand,
     {
       wand->path_operation=PathCurveToQuadraticBezierSmoothOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand,"%c%.20g %.20g",mode == AbsolutePathMode ?
+      (void) MVGAutoWrapPrintf(wand,"%c%.17g %.17g",mode == AbsolutePathMode ?
         'T' : 't',x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g",x,y);
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g",x,y);
 }

 WandExport void DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawingWand *wand,
@@ -3243,11 +3243,11 @@ static void DrawPathCurveToSmooth(DrawingWand *wand,const PathMode mode,
     {
       wand->path_operation=PathCurveToSmoothOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand,"%c%.20g %.20g %.20g %.20g",
+      (void) MVGAutoWrapPrintf(wand,"%c%.17g %.17g %.17g %.17g",
         mode == AbsolutePathMode ? 'S' : 's',x2,y2,x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g %.20g %.20g",x2,y2,x,y);
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g %.17g %.17g",x2,y2,x,y);
 }

 WandExport void DrawPathCurveToSmoothAbsolute(DrawingWand *wand,const double x2,
@@ -3373,12 +3373,12 @@ static void DrawPathEllipticArc(DrawingWand *wand, const PathMode mode,
     {
       wand->path_operation=PathEllipticArcOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand, "%c%.20g %.20g %.20g %u %u %.20g %.20g",
+      (void) MVGAutoWrapPrintf(wand, "%c%.17g %.17g %.17g %u %u %.17g %.17g",
         mode == AbsolutePathMode ? 'A' : 'a',rx,ry,x_axis_rotation,
         large_arc_flag,sweep_flag,x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g %.20g %u %u %.20g %.20g",rx,ry,
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g %.17g %u %u %.17g %.17g",rx,ry,
       x_axis_rotation,large_arc_flag,sweep_flag,x,y);
 }

@@ -3525,11 +3525,11 @@ static void DrawPathLineTo(DrawingWand *wand,const PathMode mode,
     {
       wand->path_operation=PathLineToOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand,"%c%.20g %.20g",mode == AbsolutePathMode ?
+      (void) MVGAutoWrapPrintf(wand,"%c%.17g %.17g",mode == AbsolutePathMode ?
         'L' : 'l',x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g",x,y);
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g",x,y);
 }

 WandExport void DrawPathLineToAbsolute(DrawingWand *wand,const double x,
@@ -3620,11 +3620,11 @@ static void DrawPathLineToHorizontal(DrawingWand *wand,const PathMode mode,
     {
       wand->path_operation=PathLineToHorizontalOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand,"%c%.20g",mode == AbsolutePathMode ?
+      (void) MVGAutoWrapPrintf(wand,"%c%.17g",mode == AbsolutePathMode ?
         'H' : 'h',x);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g",x);
+    (void) MVGAutoWrapPrintf(wand," %.17g",x);
 }

 WandExport void DrawPathLineToHorizontalAbsolute(DrawingWand *wand,
@@ -3710,11 +3710,11 @@ static void DrawPathLineToVertical(DrawingWand *wand,const PathMode mode,
     {
       wand->path_operation=PathLineToVerticalOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand,"%c%.20g",mode == AbsolutePathMode ?
+      (void) MVGAutoWrapPrintf(wand,"%c%.17g",mode == AbsolutePathMode ?
         'V' : 'v',y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g",y);
+    (void) MVGAutoWrapPrintf(wand," %.17g",y);
 }

 WandExport void DrawPathLineToVerticalAbsolute(DrawingWand *wand,const double y)
@@ -3803,11 +3803,11 @@ static void DrawPathMoveTo(DrawingWand *wand,const PathMode mode,const double x,
     {
       wand->path_operation=PathMoveToOperation;
       wand->path_mode=mode;
-      (void) MVGAutoWrapPrintf(wand,"%c%.20g %.20g",mode == AbsolutePathMode ?
+      (void) MVGAutoWrapPrintf(wand,"%c%.17g %.17g",mode == AbsolutePathMode ?
         'M' : 'm',x,y);
     }
   else
-    (void) MVGAutoWrapPrintf(wand," %.20g %.20g",x,y);
+    (void) MVGAutoWrapPrintf(wand," %.17g %.17g",x,y);
 }

 WandExport void DrawPathMoveToAbsolute(DrawingWand *wand,const double x,
@@ -3928,7 +3928,7 @@ WandExport void DrawPoint(DrawingWand *wand,const double x,const double y)
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"point %.20g %.20g\n",x,y);
+  (void) MVGPrintf(wand,"point %.17g %.17g\n",x,y);
 }

 /*
@@ -4115,7 +4115,7 @@ WandExport MagickBooleanType DrawPopPattern(DrawingWand *wand)
     }
   (void) FormatLocaleString(key,MagickPathExtent,"%s",wand->pattern_id);
   (void) SetImageArtifact(wand->image,key,wand->mvg+wand->pattern_offset);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g%+.20g",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g%+.20g%+.20g",
     (double) wand->pattern_bounds.width,(double) wand->pattern_bounds.height,
     (double) wand->pattern_bounds.x,(double) wand->pattern_bounds.y);
   (void) SetImageArtifact(wand->image,key,geometry);
@@ -4258,7 +4258,7 @@ WandExport MagickBooleanType DrawPushPattern(DrawingWand *wand,
       return(MagickFalse);
     }
   wand->filter_off=MagickTrue;
-  (void) MVGPrintf(wand,"push pattern %s %.20g %.20g %.20g %.20g\n",pattern_id,
+  (void) MVGPrintf(wand,"push pattern %s %.17g %.17g %.17g %.17g\n",pattern_id,
     x,y,width,height);
   wand->indent_depth++;
   wand->pattern_id=AcquireString(pattern_id);
@@ -4308,9 +4308,9 @@ WandExport void DrawRectangle(DrawingWand *wand,const double x1,const double y1,
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if ((fabs(x2-x1) < MagickEpsilon) && (fabs(y2-y1) < MagickEpsilon))
-    (void) MVGPrintf(wand,"point %.20g %.20g\n",x1,y1);
+    (void) MVGPrintf(wand,"point %.17g %.17g\n",x1,y1);
   else
-   (void) MVGPrintf(wand,"rectangle %.20g %.20g %.20g %.20g\n",x1,y1,x2,y2);
+   (void) MVGPrintf(wand,"rectangle %.17g %.17g %.17g %.17g\n",x1,y1,x2,y2);
 }

 /*
@@ -4420,7 +4420,7 @@ WandExport void DrawRotate(DrawingWand *wand,const double degrees)
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"rotate %.20g\n",degrees);
+  (void) MVGPrintf(wand,"rotate %.17g\n",degrees);
 }

 /*
@@ -4467,7 +4467,7 @@ WandExport void DrawRoundRectangle(DrawingWand *wand,double x1,double y1,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"roundrectangle %.20g %.20g %.20g %.20g %.20g %.20g\n",
+  (void) MVGPrintf(wand,"roundrectangle %.17g %.17g %.17g %.17g %.17g %.17g\n",
     x1,y1,x2,y2,rx,ry);
 }

@@ -4504,7 +4504,7 @@ WandExport void DrawScale(DrawingWand *wand,const double x,const double y)
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"scale %.20g %.20g\n",x,y);
+  (void) MVGPrintf(wand,"scale %.17g %.17g\n",x,y);
 }

 /*
@@ -4833,7 +4833,7 @@ WandExport void DrawSetFillOpacity(DrawingWand *wand,const double fill_opacity)
       (CurrentContext->fill.alpha != alpha))
     {
       CurrentContext->fill.alpha=alpha;
-      (void) MVGPrintf(wand,"fill-opacity %.20g\n",fill_opacity);
+      (void) MVGPrintf(wand,"fill-opacity %.17g\n",fill_opacity);
     }
 }

@@ -4874,7 +4874,7 @@ WandExport MagickBooleanType DrawSetFontResolution(DrawingWand *wand,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) FormatLocaleString(density,MagickPathExtent,"%.20gx%.20g",x_resolution,
+  (void) FormatLocaleString(density,MagickPathExtent,"%.17gx%.17g",x_resolution,
     y_resolution);
   (void) CloneString(&CurrentContext->density,density);
   return(MagickTrue);
@@ -4919,7 +4919,7 @@ WandExport void DrawSetOpacity(DrawingWand *wand,const double opacity)
       (CurrentContext->alpha != quantum_alpha))
     {
       CurrentContext->alpha=quantum_alpha;
-      (void) MVGPrintf(wand,"opacity %.20g\n",opacity);
+      (void) MVGPrintf(wand,"opacity %.17g\n",opacity);
     }
 }

@@ -5146,7 +5146,7 @@ WandExport void DrawSetFontSize(DrawingWand *wand,const double pointsize)
       (fabs(CurrentContext->pointsize-pointsize) >= MagickEpsilon))
     {
       CurrentContext->pointsize=pointsize;
-      (void) MVGPrintf(wand,"font-size %.20g\n",pointsize);
+      (void) MVGPrintf(wand,"font-size %.17g\n",pointsize);
     }
 }

@@ -5271,7 +5271,7 @@ WandExport void DrawSetFontWeight(DrawingWand *wand,
       (CurrentContext->weight != font_weight))
     {
       CurrentContext->weight=font_weight;
-      (void) MVGPrintf(wand,"font-weight %.20g\n",(double) font_weight);
+      (void) MVGPrintf(wand,"font-weight %.17g\n",(double) font_weight);
     }
 }

@@ -5591,7 +5591,7 @@ WandExport MagickBooleanType DrawSetStrokeDashArray(DrawingWand *wand,
             {
               if (i != 0)
                 (void) MVGPrintf(wand,",");
-              (void) MVGPrintf(wand,"%.20g",dasharray[i]);
+              (void) MVGPrintf(wand,"%.17g",dasharray[i]);
             }
             (void) MVGPrintf(wand,"\n");
           }
@@ -5636,7 +5636,7 @@ WandExport void DrawSetStrokeDashOffset(DrawingWand *wand,
      (fabs(CurrentContext->dash_offset-dash_offset) >= MagickEpsilon))
     {
       CurrentContext->dash_offset=dash_offset;
-      (void) MVGPrintf(wand,"stroke-dashoffset %.20g\n",dash_offset);
+      (void) MVGPrintf(wand,"stroke-dashoffset %.17g\n",dash_offset);
     }
 }

@@ -5762,7 +5762,7 @@ WandExport void DrawSetStrokeMiterLimit(DrawingWand *wand,
   if (CurrentContext->miterlimit != miterlimit)
     {
       CurrentContext->miterlimit=miterlimit;
-      (void) MVGPrintf(wand,"stroke-miterlimit %.20g\n",(double) miterlimit);
+      (void) MVGPrintf(wand,"stroke-miterlimit %.17g\n",(double) miterlimit);
     }
 }

@@ -5806,7 +5806,7 @@ WandExport void DrawSetStrokeOpacity(DrawingWand *wand,
       (CurrentContext->stroke.alpha != alpha))
     {
       CurrentContext->stroke.alpha=alpha;
-      (void) MVGPrintf(wand,"stroke-opacity %.20g\n",opacity);
+      (void) MVGPrintf(wand,"stroke-opacity %.17g\n",opacity);
     }
 }

@@ -5846,7 +5846,7 @@ WandExport void DrawSetStrokeWidth(DrawingWand *wand,const double stroke_width)
       (fabs(CurrentContext->stroke_width-stroke_width) >= MagickEpsilon))
     {
       CurrentContext->stroke_width=stroke_width;
-      (void) MVGPrintf(wand,"stroke-width %.20g\n",stroke_width);
+      (void) MVGPrintf(wand,"stroke-width %.17g\n",stroke_width);
     }
 }

@@ -6590,7 +6590,7 @@ WandExport void DrawSkewX(DrawingWand *wand,const double degrees)
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"skewX %.20g\n",degrees);
+  (void) MVGPrintf(wand,"skewX %.17g\n",degrees);
 }

 /*
@@ -6624,7 +6624,7 @@ WandExport void DrawSkewY(DrawingWand *wand,const double degrees)
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"skewY %.20g\n",degrees);
+  (void) MVGPrintf(wand,"skewY %.17g\n",degrees);
 }

 /*
@@ -6662,7 +6662,7 @@ WandExport void DrawTranslate(DrawingWand *wand,const double x,const double y)
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"translate %.20g %.20g\n",x,y);
+  (void) MVGPrintf(wand,"translate %.17g %.17g\n",x,y);
 }

 /*
@@ -6707,7 +6707,7 @@ WandExport void DrawSetViewbox(DrawingWand *wand,const double x1,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MVGPrintf(wand,"viewbox %.20g %.20g %.20g %.20g\n",x1,y1,x2,y2);
+  (void) MVGPrintf(wand,"viewbox %.17g %.17g %.17g %.17g\n",x1,y1,x2,y2);
 }

 /*
@@ -6774,7 +6774,7 @@ WandExport DrawingWand *NewDrawingWand(void)
       (char *) NULL);
   (void) memset(wand,0,sizeof(*wand));
   wand->id=AcquireWandId();
-  (void) FormatLocaleString(wand->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(wand->name,MagickPathExtent,"%s-%.17g",
     DrawingWandId,(double) wand->id);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
diff --git a/MagickWand/magick-cli.c b/MagickWand/magick-cli.c
index 349ade10f..62ce1859a 100644
--- a/MagickWand/magick-cli.c
+++ b/MagickWand/magick-cli.c
@@ -287,7 +287,7 @@ WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *image_info,
       e=((1.0/(1.0/((serial/(serial+parallel))+(1.0-(serial/(serial+parallel)))/
         (double) n)))-(1.0/(double) n))/(1.0-1.0/(double) n);
     (void) FormatLocaleFile(stderr,
-      "  Performance[%.20g]: %.20gi %0.3fips %0.6fe %0.6fu %lu:%02lu.%03lu\n",
+      "  Performance[%.17g]: %.17gi %0.3fips %0.6fe %0.6fu %lu:%02lu.%03lu\n",
       (double) n,(double) iterations,(double) iterations/parallel,e,user_time,
       (unsigned long) (parallel/60.0),(unsigned long) floor(fmod(parallel,
       60.0)),(unsigned long) (1000.0*(parallel-floor(parallel))+0.5));
diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c
index 1a694c256..24aa6de05 100644
--- a/MagickWand/magick-image.c
+++ b/MagickWand/magick-image.c
@@ -98,7 +98,7 @@ static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
   clone_wand=(MagickWand *) AcquireCriticalMemory(sizeof(*clone_wand));
   (void) memset(clone_wand,0,sizeof(*clone_wand));
   clone_wand->id=AcquireWandId();
-  (void) FormatLocaleString(clone_wand->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(clone_wand->name,MagickPathExtent,"%s-%.17g",
     MagickWandId,(double) clone_wand->id);
   clone_wand->exception=AcquireExceptionInfo();
   InheritException(clone_wand->exception,wand->exception);
diff --git a/MagickWand/magick-property.c b/MagickWand/magick-property.c
index 30a40ed9d..2dfffd964 100644
--- a/MagickWand/magick-property.c
+++ b/MagickWand/magick-property.c
@@ -2619,7 +2619,7 @@ WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g%+.20g",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g%+.20g%+.20g",
     (double) width,(double) height,(double) x,(double) y);
   (void) CloneString(&wand->image_info->page,geometry);
   return(MagickTrue);
@@ -2986,7 +2986,7 @@ WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",(double)
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g",(double)
     columns,(double) rows);
   (void) CloneString(&wand->image_info->size,geometry);
   return(MagickTrue);
@@ -3033,7 +3033,7 @@ WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
   assert(wand->signature == MagickWandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g%+.20g",
     (double) columns,(double) rows,(double) offset);
   (void) CloneString(&wand->image_info->size,geometry);
   return(MagickTrue);
diff --git a/MagickWand/magick-wand.c b/MagickWand/magick-wand.c
index 6ffcb68ee..960a8ec35 100644
--- a/MagickWand/magick-wand.c
+++ b/MagickWand/magick-wand.c
@@ -123,7 +123,7 @@ WandExport MagickWand *CloneMagickWand(const MagickWand *wand)
   clone_wand=(MagickWand *) AcquireCriticalMemory(sizeof(*clone_wand));
   (void) memset(clone_wand,0,sizeof(*clone_wand));
   clone_wand->id=AcquireWandId();
-  (void) FormatLocaleString(clone_wand->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(clone_wand->name,MagickPathExtent,"%s-%.17g",
     MagickWandId,(double) clone_wand->id);
   clone_wand->exception=AcquireExceptionInfo();
   InheritException(clone_wand->exception,wand->exception);
@@ -1082,7 +1082,7 @@ WandExport MagickWand *NewMagickWand(void)
       (char *) NULL);
   (void) memset(wand,0,sizeof(*wand));
   wand->id=AcquireWandId();
-  (void) FormatLocaleString(wand->name,MagickPathExtent,"%s-%.20g",MagickWandId,
+  (void) FormatLocaleString(wand->name,MagickPathExtent,"%s-%.17g",MagickWandId,
     (double) wand->id);
   wand->images=NewImageList();
   wand->image_info=AcquireImageInfo();
diff --git a/MagickWand/montage.c b/MagickWand/montage.c
index 011aba218..17647c6a3 100644
--- a/MagickWand/montage.c
+++ b/MagickWand/montage.c
@@ -413,7 +413,7 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info,
                 image_info->filename,(int) scene,scene_filename,exception);
               if (LocaleCompare(filename,image_info->filename) == 0)
                 (void) FormatLocaleString(scene_filename,MagickPathExtent,
-                  "%s.%.20g",image_info->filename,(double) scene);
+                  "%s.%.17g",image_info->filename,(double) scene);
               images=ReadImages(image_info,scene_filename,exception);
             }
           status&=(MagickStatusType) (images != (Image *) NULL) &&
diff --git a/MagickWand/pixel-iterator.c b/MagickWand/pixel-iterator.c
index 9dd45b549..4f5889447 100644
--- a/MagickWand/pixel-iterator.c
+++ b/MagickWand/pixel-iterator.c
@@ -166,7 +166,7 @@ WandExport PixelIterator *ClonePixelIterator(const PixelIterator *iterator)
     sizeof(*clone_iterator));
   (void) memset(clone_iterator,0,sizeof(*clone_iterator));
   clone_iterator->id=AcquireWandId();
-  (void) FormatLocaleString(clone_iterator->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(clone_iterator->name,MagickPathExtent,"%s-%.17g",
     PixelIteratorId,(double) clone_iterator->id);
   clone_iterator->exception=AcquireExceptionInfo();
   InheritException(clone_iterator->exception,iterator->exception);
@@ -307,7 +307,7 @@ WandExport PixelIterator *NewPixelIterator(MagickWand *wand)
   iterator=(PixelIterator *) AcquireCriticalMemory(sizeof(*iterator));
   (void) memset(iterator,0,sizeof(*iterator));
   iterator->id=AcquireWandId();
-  (void) FormatLocaleString(iterator->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(iterator->name,MagickPathExtent,"%s-%.17g",
     PixelIteratorId,(double) iterator->id);
   iterator->exception=exception;
   iterator->view=view;
@@ -413,7 +413,7 @@ WandExport PixelIterator *NewPixelRegionIterator(MagickWand *wand,
   iterator=(PixelIterator *) AcquireCriticalMemory(sizeof(*iterator));
   (void) memset(iterator,0,sizeof(*iterator));
   iterator->id=AcquireWandId();
-  (void) FormatLocaleString(iterator->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(iterator->name,MagickPathExtent,"%s-%.17g",
     PixelIteratorId,(double) iterator->id);
   iterator->exception=exception;
   iterator->view=view;
diff --git a/MagickWand/pixel-wand.c b/MagickWand/pixel-wand.c
index a57737f92..2c844718e 100644
--- a/MagickWand/pixel-wand.c
+++ b/MagickWand/pixel-wand.c
@@ -151,7 +151,7 @@ WandExport PixelWand *ClonePixelWand(const PixelWand *wand)
   clone_wand=(PixelWand *) AcquireCriticalMemory(sizeof(*clone_wand));
   (void) memset(clone_wand,0,sizeof(*clone_wand));
   clone_wand->id=AcquireWandId();
-  (void) FormatLocaleString(clone_wand->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(clone_wand->name,MagickPathExtent,"%s-%.17g",
     PixelWandId,(double) clone_wand->id);
   clone_wand->exception=AcquireExceptionInfo();
   InheritException(clone_wand->exception,wand->exception);
@@ -388,7 +388,7 @@ WandExport PixelWand *NewPixelWand(void)
   wand=(PixelWand *) AcquireCriticalMemory(sizeof(*wand));
   (void) memset(wand,0,sizeof(*wand));
   wand->id=AcquireWandId();
-  (void) FormatLocaleString(wand->name,MagickPathExtent,"%s-%.20g",PixelWandId,
+  (void) FormatLocaleString(wand->name,MagickPathExtent,"%s-%.17g",PixelWandId,
     (double) wand->id);
   wand->exception=AcquireExceptionInfo();
   GetPixelInfo((Image *) NULL,&wand->pixel);
diff --git a/MagickWand/wand-view.c b/MagickWand/wand-view.c
index 478c54459..071e9efbb 100644
--- a/MagickWand/wand-view.c
+++ b/MagickWand/wand-view.c
@@ -130,7 +130,7 @@ WandExport WandView *CloneWandView(const WandView *wand_view)
   clone_view=(WandView *) AcquireCriticalMemory(sizeof(*clone_view));
   (void) memset(clone_view,0,sizeof(*clone_view));
   clone_view->id=AcquireWandId();
-  (void) FormatLocaleString(clone_view->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(clone_view->name,MagickPathExtent,"%s-%.17g",
     WandViewId,(double) clone_view->id);
   clone_view->description=ConstantString(wand_view->description);
   clone_view->image=CloneImage(wand_view->image,0,0,MagickTrue,
@@ -751,7 +751,7 @@ WandExport WandView *NewWandView(MagickWand *wand)
   wand_view=(WandView *) AcquireCriticalMemory(sizeof(*wand_view));
   (void) memset(wand_view,0,sizeof(*wand_view));
   wand_view->id=AcquireWandId();
-  (void) FormatLocaleString(wand_view->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(wand_view->name,MagickPathExtent,"%s-%.17g",
     WandViewId,(double) wand_view->id);
   wand_view->description=ConstantString("WandView");
   wand_view->wand=wand;
@@ -811,7 +811,7 @@ WandExport WandView *NewWandViewExtent(MagickWand *wand,const ssize_t x,
   wand_view=(WandView *) AcquireCriticalMemory(sizeof(*wand_view));
   (void) memset(wand_view,0,sizeof(*wand_view));
   wand_view->id=AcquireWandId();
-  (void) FormatLocaleString(wand_view->name,MagickPathExtent,"%s-%.20g",
+  (void) FormatLocaleString(wand_view->name,MagickPathExtent,"%s-%.17g",
     WandViewId,(double) wand_view->id);
   wand_view->description=ConstantString("WandView");
   exception=AcquireExceptionInfo();
diff --git a/MagickWand/wandcli.c b/MagickWand/wandcli.c
index 5c18afb0c..13fd6a3f9 100644
--- a/MagickWand/wandcli.c
+++ b/MagickWand/wandcli.c
@@ -80,7 +80,7 @@ WandExport MagickCLI *AcquireMagickCLI(ImageInfo *image_info,
   cli_wand=(MagickCLI *) AcquireCriticalMemory(sizeof(*cli_wand));
   cli_wand->wand.id=AcquireWandId();
   (void) FormatLocaleString(cli_wand->wand.name,MagickPathExtent,
-    "%s-%.20g","MagickWandCLI", (double) cli_wand->wand.id);
+    "%s-%.17g","MagickWandCLI", (double) cli_wand->wand.id);
   cli_wand->wand.images=NewImageList();
   if ( image_info == (ImageInfo *) NULL)
     cli_wand->wand.image_info=AcquireImageInfo();
diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs
index 463bc3479..34dc5ad01 100644
--- a/PerlMagick/Magick.xs
+++ b/PerlMagick/Magick.xs
@@ -980,7 +980,7 @@ static Image *GetList(pTHX_ SV *reference,SV ***reference_vector,
     default:
       break;
   }
-  (void) fprintf(stderr,"GetList: UnrecognizedType %.20g\n",
+  (void) fprintf(stderr,"GetList: UnrecognizedType %.17g\n",
     (double) SvTYPE(reference));
   return((Image *) NULL);
 }
@@ -4161,46 +4161,46 @@ Features(ref,...)
   {
 #define ChannelFeatures(channel,direction) \
 { \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].angular_second_moment[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].contrast[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].contrast[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].variance_sum_of_squares[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].inverse_difference_moment[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].sum_average[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].sum_variance[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].sum_entropy[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].entropy[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].difference_variance[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].difference_entropy[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].measure_of_correlation_1[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].measure_of_correlation_2[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].maximum_correlation_coefficient[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
 }
@@ -4745,7 +4745,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->background_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->background_color.red,
                 (double) image->background_color.green,
                 (double) image->background_color.blue,
                 (double) image->background_color.alpha);
@@ -4792,7 +4792,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.blue_primary.x,
                 image->chromaticity.blue_primary.y);
               s=newSVpv(color,0);
@@ -4804,7 +4804,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->border_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->border_color.red,
                 (double) image->border_color.green,
                 (double) image->border_color.blue,
                 (double) image->border_color.alpha);
@@ -4824,7 +4824,7 @@ Get(ref,...)
                 break;
               page=GetImageBoundingBox(image,exception);
               (void) FormatLocaleString(geometry,MagickPathExtent,
-                "%.20gx%.20g%+.20g%+.20g",(double) page.width,(double)
+                "%.17gx%.17g%+.20g%+.20g",(double) page.width,(double)
                 page.height,(double) page.x,(double) page.y);
               s=newSVpv(geometry,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -4939,7 +4939,7 @@ Get(ref,...)
               if (j > (ssize_t) image->colors)
                 j%=(ssize_t) image->colors;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->colormap[j].red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->colormap[j].red,
                 (double) image->colormap[j].green,
                 (double) image->colormap[j].blue,
                 (double) image->colormap[j].alpha);
@@ -4985,7 +4985,7 @@ Get(ref,...)

               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",
+              (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g",
                 image->resolution.x,image->resolution.y);
               s=newSVpv(geometry,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -5179,7 +5179,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.green_primary.x,
                 image->chromaticity.green_primary.y);
               s=newSVpv(color,0);
@@ -5250,7 +5250,7 @@ Get(ref,...)
                   static ssize_t
                     id = 0;

-                  (void) FormatLocaleString(key,MagickPathExtent,"%.20g\n",(double)
+                  (void) FormatLocaleString(key,MagickPathExtent,"%.17g\n",(double)
                     id);
                   status=SetImageRegistry(ImageRegistryType,key,image,
                     exception);
@@ -5417,7 +5417,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->alpha_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->alpha_color.red,
                 (double) image->alpha_color.green,
                 (double) image->alpha_color.blue,
                 (double) image->alpha_color.alpha);
@@ -5510,7 +5510,7 @@ Get(ref,...)
                     geometry[MagickPathExtent];

                   (void) FormatLocaleString(geometry,MagickPathExtent,
-                    "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,
+                    "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,
                     (double) image->page.height,(double) image->page.x,(double)
                     image->page.y);
                   s=newSVpv(geometry,0);
@@ -5625,7 +5625,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.red_primary.x,
                 image->chromaticity.red_primary.y);
               s=newSVpv(color,0);
@@ -5741,7 +5741,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->transparent_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->transparent_color.red,
                 (double) image->transparent_color.green,
                 (double) image->transparent_color.blue,
                 (double) image->transparent_color.alpha);
@@ -5834,7 +5834,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.white_point.x,
                 image->chromaticity.white_point.y);
               s=newSVpv(color,0);
@@ -6463,25 +6463,25 @@ Histogram(ref,...)
       EXTEND(sp,6*count);
       for (i=0; i < (ssize_t) number_colors; i++)
       {
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].red);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].green);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].blue);
         PUSHs(sv_2mortal(newSVpv(message,0)));
         if (image->colorspace == CMYKColorspace)
           {
-            (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+            (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
               histogram[i].black);
             PUSHs(sv_2mortal(newSVpv(message,0)));
           }
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].alpha);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
           histogram[i].count);
         PUSHs(sv_2mortal(newSVpv(message,0)));
       }
@@ -7958,7 +7958,7 @@ Mogrify(ref,...)
       {
         default:
         {
-          (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double) ix);
+          (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double) ix);
           ThrowPerlException(exception,OptionError,
             "UnrecognizedPerlMagickMethod",message);
           goto PerlException;
@@ -8897,7 +8897,7 @@ Mogrify(ref,...)
             Composite two images (normal composition).
           */
           (void) FormatLocaleString(composite_geometry,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,
+            "%.17gx%.17g%+.20g%+.20g",(double) composite_image->columns,
             (double) composite_image->rows,(double) geometry.x,(double)
             geometry.y);
           flags=ParseGravityGeometry(image,composite_geometry,&geometry,
@@ -9212,7 +9212,7 @@ Mogrify(ref,...)
           if (attribute_flag[0] == 0)
             {
               (void) FormatLocaleString(message,MagickPathExtent,
-                "%.20g,%.20g,%.20g",(double) argument_list[2].real_reference,
+                "%.17g,%.17g,%.17g",(double) argument_list[2].real_reference,
                 (double) argument_list[3].real_reference,
                 (double) argument_list[4].real_reference);
               argument_list[0].string_reference=message;
@@ -9320,7 +9320,7 @@ Mogrify(ref,...)
               geometry_info.rho=argument_list[6].real_reference;
               SetImageArtifact(image,"modulate:colorspace","HWB");
             }
-          (void) FormatLocaleString(modulate,MagickPathExtent,"%.20g,%.20g,%.20g",
+          (void) FormatLocaleString(modulate,MagickPathExtent,"%.17g,%.17g,%.17g",
             geometry_info.rho,geometry_info.sigma,geometry_info.xi);
           (void) ModulateImage(image,modulate,exception);
           break;
@@ -12384,7 +12384,7 @@ PerceptualHash(ref)

           for (k=0; k < (ssize_t) channel_phash[0].number_colorspaces; k++)
           {
-            (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+            (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
               channel_phash[channel].phash[k][j]);
             PUSHs(sv_2mortal(newSVpv(message,0)));
           }
@@ -12949,7 +12949,7 @@ QueryFont(ref,...)
       else
         PUSHs(sv_2mortal(newSVpv(CommandOptionToMnemonic(MagickStretchOptions,
           type_info->stretch),0)));
-      (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
         type_info->weight);
       PUSHs(sv_2mortal(newSVpv(message,0)));
       if (type_info->encoding == (char *) NULL)
@@ -13357,7 +13357,7 @@ QueryFontMetrics(ref,...)
       {
         draw_info->geometry=AcquireString((char *) NULL);
         (void) FormatLocaleString(draw_info->geometry,MagickPathExtent,
-          "%.20g,%.20g",x,y);
+          "%.17g,%.17g",x,y);
       }
     status=GetTypeMetrics(image,draw_info,&metrics,exception);
     (void) CatchImageException(image);
@@ -13728,7 +13728,7 @@ QueryMultilineFontMetrics(ref,...)
       {
         draw_info->geometry=AcquireString((char *) NULL);
         (void) FormatLocaleString(draw_info->geometry,MagickPathExtent,
-          "%.20g,%.20g",x,y);
+          "%.17g,%.17g",x,y);
       }
     status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
     (void) CatchException(exception);
@@ -14917,28 +14917,28 @@ Statistics(ref,...)
   {
 #define ChannelStatistics(channel) \
 { \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     (double) channel_statistics[channel].depth); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].minima/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].maxima/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].mean/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].standard_deviation/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].kurtosis); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].skewness); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].entropy); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
 }
diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in
index 18bcf7251..1e0da349e 100644
--- a/PerlMagick/quantum/quantum.xs.in
+++ b/PerlMagick/quantum/quantum.xs.in
@@ -980,7 +980,7 @@ static Image *GetList(pTHX_ SV *reference,SV ***reference_vector,
     default:
       break;
   }
-  (void) fprintf(stderr,"GetList: UnrecognizedType %.20g\n",
+  (void) fprintf(stderr,"GetList: UnrecognizedType %.17g\n",
     (double) SvTYPE(reference));
   return((Image *) NULL);
 }
@@ -4167,46 +4167,46 @@ Features(ref,...)
   {
 #define ChannelFeatures(channel,direction) \
 { \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].angular_second_moment[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].contrast[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].contrast[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].variance_sum_of_squares[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].inverse_difference_moment[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].sum_average[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].sum_variance[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].sum_entropy[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].entropy[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].difference_variance[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].difference_entropy[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].measure_of_correlation_1[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].measure_of_correlation_2[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_features[channel].maximum_correlation_coefficient[direction]); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
 }
@@ -4752,7 +4752,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->background_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->background_color.red,
                 (double) image->background_color.green,
                 (double) image->background_color.blue,
                 (double) image->background_color.alpha);
@@ -4799,7 +4799,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.blue_primary.x,
                 image->chromaticity.blue_primary.y);
               s=newSVpv(color,0);
@@ -4811,7 +4811,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->border_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->border_color.red,
                 (double) image->border_color.green,
                 (double) image->border_color.blue,
                 (double) image->border_color.alpha);
@@ -4831,7 +4831,7 @@ Get(ref,...)
                 break;
               page=GetImageBoundingBox(image,exception);
               (void) FormatLocaleString(geometry,MagickPathExtent,
-                "%.20gx%.20g%+.20g%+.20g",(double) page.width,(double)
+                "%.17gx%.17g%+.20g%+.20g",(double) page.width,(double)
                 page.height,(double) page.x,(double) page.y);
               s=newSVpv(geometry,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -4946,7 +4946,7 @@ Get(ref,...)
               if (j > (ssize_t) image->colors)
                 j%=(ssize_t) image->colors;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->colormap[j].red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->colormap[j].red,
                 (double) image->colormap[j].green,
                 (double) image->colormap[j].blue,
                 (double) image->colormap[j].alpha);
@@ -4992,7 +4992,7 @@ Get(ref,...)

               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",
+              (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g",
                 image->resolution.x,image->resolution.y);
               s=newSVpv(geometry,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -5187,7 +5187,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.green_primary.x,
                 image->chromaticity.green_primary.y);
               s=newSVpv(color,0);
@@ -5258,7 +5258,7 @@ Get(ref,...)
                   static ssize_t
                     id = 0;

-                  (void) FormatLocaleString(key,MagickPathExtent,"%.20g\n",(double)
+                  (void) FormatLocaleString(key,MagickPathExtent,"%.17g\n",(double)
                     id);
                   status=SetImageRegistry(ImageRegistryType,key,image,
                     exception);
@@ -5425,7 +5425,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->alpha_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->alpha_color.red,
                 (double) image->alpha_color.green,
                 (double) image->alpha_color.blue,
                 (double) image->alpha_color.alpha);
@@ -5518,7 +5518,7 @@ Get(ref,...)
                     geometry[MagickPathExtent];

                   (void) FormatLocaleString(geometry,MagickPathExtent,
-                    "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,
+                    "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,
                     (double) image->page.height,(double) image->page.x,(double)
                     image->page.y);
                   s=newSVpv(geometry,0);
@@ -5633,7 +5633,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.red_primary.x,
                 image->chromaticity.red_primary.y);
               s=newSVpv(color,0);
@@ -5756,7 +5756,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(color,MagickPathExtent,
-                "%.20g,%.20g,%.20g,%.20g",(double) image->transparent_color.red,
+                "%.17g,%.17g,%.17g,%.17g",(double) image->transparent_color.red,
                 (double) image->transparent_color.green,
                 (double) image->transparent_color.blue,
                 (double) image->transparent_color.alpha);
@@ -5849,7 +5849,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MagickPathExtent,"%.20g,%.20g",
+              (void) FormatLocaleString(color,MagickPathExtent,"%.17g,%.17g",
                 image->chromaticity.white_point.x,
                 image->chromaticity.white_point.y);
               s=newSVpv(color,0);
@@ -6480,25 +6480,25 @@ Histogram(ref,...)
       EXTEND(sp,6*count);
       for (i=0; i < (ssize_t) number_colors; i++)
       {
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].red);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].green);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].blue);
         PUSHs(sv_2mortal(newSVpv(message,0)));
         if (image->colorspace == CMYKColorspace)
           {
-            (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+            (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
               histogram[i].black);
             PUSHs(sv_2mortal(newSVpv(message,0)));
           }
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
           histogram[i].alpha);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+        (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
           histogram[i].count);
         PUSHs(sv_2mortal(newSVpv(message,0)));
       }
@@ -7976,7 +7976,7 @@ Mogrify(ref,...)
       {
         default:
         {
-          (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+          (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
             ix);
           ThrowPerlException(exception,OptionError,
             "UnrecognizedPerlMagickMethod",message);
@@ -8918,7 +8918,7 @@ Mogrify(ref,...)
             Composite two images (normal composition).
           */
           (void) FormatLocaleString(composite_geometry,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,
+            "%.17gx%.17g%+.20g%+.20g",(double) composite_image->columns,
             (double) composite_image->rows,(double) geometry.x,(double)
             geometry.y);
           flags=ParseGravityGeometry(image,composite_geometry,&geometry,
@@ -9236,7 +9236,7 @@ Mogrify(ref,...)
           if (attribute_flag[0] == 0)
             {
               (void) FormatLocaleString(message,MagickPathExtent,
-                "%.20g,%.20g,%.20g",(double) argument_list[2].real_reference,
+                "%.17g,%.17g,%.17g",(double) argument_list[2].real_reference,
                 (double) argument_list[3].real_reference,
                 (double) argument_list[4].real_reference);
               argument_list[0].string_reference=message;
@@ -9345,7 +9345,7 @@ Mogrify(ref,...)
               SetImageArtifact(image,"modulate:colorspace","HWB");
             }
           (void) FormatLocaleString(modulate,MagickPathExtent,
-            "%.20g,%.20g,%.20g",geometry_info.rho,geometry_info.sigma,
+            "%.17g,%.17g,%.17g",geometry_info.rho,geometry_info.sigma,
             geometry_info.xi);
           (void) ModulateImage(image,modulate,exception);
           break;
@@ -12407,7 +12407,7 @@ PerceptualHash(ref)

           for (k=0; k < (ssize_t) channel_phash[0].number_colorspaces; k++)
           {
-            (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+            (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
               channel_phash[channel].phash[k][j]);
             PUSHs(sv_2mortal(newSVpv(message,0)));
           }
@@ -12972,7 +12972,7 @@ QueryFont(ref,...)
       else
         PUSHs(sv_2mortal(newSVpv(CommandOptionToMnemonic(MagickStretchOptions,
           type_info->stretch),0)));
-      (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+      (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
         type_info->weight);
       PUSHs(sv_2mortal(newSVpv(message,0)));
       if (type_info->encoding == (char *) NULL)
@@ -13380,7 +13380,7 @@ QueryFontMetrics(ref,...)
       {
         draw_info->geometry=AcquireString((char *) NULL);
         (void) FormatLocaleString(draw_info->geometry,MagickPathExtent,
-          "%.20g,%.20g",x,y);
+          "%.17g,%.17g",x,y);
       }
     status=GetTypeMetrics(image,draw_info,&metrics,exception);
     (void) CatchImageException(image);
@@ -13751,7 +13751,7 @@ QueryMultilineFontMetrics(ref,...)
       {
         draw_info->geometry=AcquireString((char *) NULL);
         (void) FormatLocaleString(draw_info->geometry,MagickPathExtent,
-          "%.20g,%.20g",x,y);
+          "%.17g,%.17g",x,y);
       }
     status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
     (void) CatchException(exception);
@@ -14940,28 +14940,28 @@ Statistics(ref)
   {
 #define ChannelStatistics(channel) \
 { \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     (double) channel_statistics[channel].depth); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].minima/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].maxima/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].mean/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].standard_deviation/QuantumRange); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].kurtosis); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].skewness); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g", \
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g", \
     channel_statistics[channel].entropy); \
   PUSHs(sv_2mortal(newSVpv(message,0))); \
 }
diff --git a/coders/bmp.c b/coders/bmp.c
index 71b30f91a..d2aa19771 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -736,7 +736,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
               "  Format: OS/2 Bitmap");
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Geometry: %.20gx%.20g",(double) bmp_info.width,(double)
+              "  Geometry: %.17gx%.17g",(double) bmp_info.width,(double)
               bmp_info.height);
           }
       }
@@ -776,10 +776,10 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
               "  Format: MS Windows bitmap");
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Geometry: %.20gx%.20g",(double) bmp_info.width,(double)
+              "  Geometry: %.17gx%.17g",(double) bmp_info.width,(double)
               bmp_info.height);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Bits per pixel: %.20g",(double) bmp_info.bits_per_pixel);
+              "  Bits per pixel: %.17g",(double) bmp_info.bits_per_pixel);
             switch (bmp_info.compression)
             {
               case BI_RGB:
@@ -1069,7 +1069,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
         */
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  Reading colormap of %.20g colors",(double) image->colors);
+            "  Reading colormap of %.17g colors",(double) image->colors);
         if (AcquireImageColormap(image,image->colors,exception) == MagickFalse)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t)
@@ -1136,7 +1136,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
       {
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  Reading pixels (%.20g bytes)",(double) length);
+            "  Reading pixels (%.17g bytes)",(double) length);
         count=ReadBlob(image,length,pixels);
         if (count != (ssize_t) length)
           {
@@ -2401,7 +2401,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
     if (image->debug != MagickFalse)
       {
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "   Writing BMP version %.20g datastream",(double) type);
+          "   Writing BMP version %.17g datastream",(double) type);
         if (image->storage_class == DirectClass)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Storage class=DirectClass");
@@ -2409,7 +2409,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Storage class=PseudoClass");
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "   Image depth=%.20g",(double) image->depth);
+          "   Image depth=%.17g",(double) image->depth);
         if (image->alpha_trait != UndefinedPixelTrait)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Matte=True");
@@ -2417,7 +2417,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Matte=MagickFalse");
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "   BMP bits_per_pixel=%.20g",(double) bmp_info.bits_per_pixel);
+          "   BMP bits_per_pixel=%.17g",(double) bmp_info.bits_per_pixel);
         switch ((int) bmp_info.compression)
         {
            case BI_RGB:
@@ -2623,7 +2623,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
         */
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  Colormap: %.20g entries",(double) image->colors);
+            "  Colormap: %.17g entries",(double) image->colors);
         bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t) 1UL <<
           bmp_info.bits_per_pixel,4*sizeof(*bmp_colormap));
         if (bmp_colormap == (unsigned char *) NULL)
diff --git a/coders/braille.c b/coders/braille.c
index efe716190..7db4142b0 100644
--- a/coders/braille.c
+++ b/coders/braille.c
@@ -259,20 +259,20 @@ static MagickBooleanType WriteBRAILLEImage(const ImageInfo *image_info,
         }
       if (image->page.x != 0)
         {
-          (void) FormatLocaleString(buffer,MagickPathExtent,"X: %.20g\n",
+          (void) FormatLocaleString(buffer,MagickPathExtent,"X: %.17g\n",
             (double) image->page.x);
           (void) WriteBlobString(image,buffer);
         }
       if (image->page.y != 0)
         {
-          (void) FormatLocaleString(buffer,MagickPathExtent,"Y: %.20g\n",
+          (void) FormatLocaleString(buffer,MagickPathExtent,"Y: %.17g\n",
             (double) image->page.y);
           (void) WriteBlobString(image,buffer);
         }
-      (void) FormatLocaleString(buffer,MagickPathExtent,"Width: %.20g\n",
+      (void) FormatLocaleString(buffer,MagickPathExtent,"Width: %.17g\n",
         (double) (image->columns+(image->columns % 2)));
       (void) WriteBlobString(image,buffer);
-      (void) FormatLocaleString(buffer,MagickPathExtent,"Height: %.20g\n",
+      (void) FormatLocaleString(buffer,MagickPathExtent,"Height: %.17g\n",
         (double) image->rows);
       (void) WriteBlobString(image,buffer);
       (void) WriteBlobString(image,"\n");
diff --git a/coders/cin.c b/coders/cin.c
index bf819dc9c..58c4bc9b2 100644
--- a/coders/cin.c
+++ b/coders/cin.c
@@ -590,12 +590,12 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
   cin.origination.x_offset=ReadBlobSignedLong(image);
   offset+=4;
   if ((size_t) cin.origination.x_offset != ~0UL)
-    (void) FormatImageProperty(image,"dpx:origination.x_offset","%.20g",
+    (void) FormatImageProperty(image,"dpx:origination.x_offset","%.17g",
       (double) cin.origination.x_offset);
   cin.origination.y_offset=(ssize_t) ReadBlobLong(image);
   offset+=4;
   if ((size_t) cin.origination.y_offset != ~0UL)
-    (void) FormatImageProperty(image,"dpx:origination.y_offset","%.20g",
+    (void) FormatImageProperty(image,"dpx:origination.y_offset","%.17g",
       (double) cin.origination.y_offset);
   offset+=ReadBlob(image,sizeof(cin.origination.filename),(unsigned char *)
     cin.origination.filename);
@@ -670,7 +670,7 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
       cin.film.prefix=ReadBlobLong(image);
       offset+=4;
       if (cin.film.prefix != ~0UL)
-        (void) FormatImageProperty(image,"dpx:film.prefix","%.20g",(double)
+        (void) FormatImageProperty(image,"dpx:film.prefix","%.17g",(double)
           cin.film.prefix);
       cin.film.count=ReadBlobLong(image);
       offset+=4;
@@ -681,7 +681,7 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
       cin.film.frame_position=ReadBlobLong(image);
       offset+=4;
       if (cin.film.frame_position != ~0UL)
-        (void) FormatImageProperty(image,"dpx:film.frame_position","%.20g",
+        (void) FormatImageProperty(image,"dpx:film.frame_position","%.17g",
           (double) cin.film.frame_position);
       cin.film.frame_rate=ReadBlobFloat(image);
       offset+=4;
diff --git a/coders/cip.c b/coders/cip.c
index 9c0095f08..5516cdbbb 100644
--- a/coders/cip.c
+++ b/coders/cip.c
@@ -212,15 +212,15 @@ static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image,
     }
   (void) WriteBlobString(image,buffer);
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    "<LocationX>%.20g</LocationX>\n",(double) image->page.x);
+    "<LocationX>%.17g</LocationX>\n",(double) image->page.x);
   (void) WriteBlobString(image,buffer);
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    "<LocationY>%.20g</LocationY>\n",(double) image->page.y);
+    "<LocationY>%.17g</LocationY>\n",(double) image->page.y);
   (void) WriteBlobString(image,buffer);
-  (void) FormatLocaleString(buffer,MagickPathExtent,"<Width>%.20g</Width>\n",
+  (void) FormatLocaleString(buffer,MagickPathExtent,"<Width>%.17g</Width>\n",
     (double) (image->columns+(image->columns % 2)));
   (void) WriteBlobString(image,buffer);
-  (void) FormatLocaleString(buffer,MagickPathExtent,"<Height>%.20g</Height>\n",
+  (void) FormatLocaleString(buffer,MagickPathExtent,"<Height>%.17g</Height>\n",
     (double) image->rows);
   (void) WriteBlobString(image,buffer);
   (void) FormatLocaleString(buffer,MagickPathExtent,"<Depth>2</Depth>\n");
diff --git a/coders/debug.c b/coders/debug.c
index 68256f0a3..20f74038b 100644
--- a/coders/debug.c
+++ b/coders/debug.c
@@ -211,7 +211,7 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info,
     if (image->alpha_trait != UndefinedPixelTrait)
       (void) ConcatenateMagickString(colorspace,"a",MagickPathExtent);
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "# ImageMagick pixel debugging: %.20g,%.20g,%.20g,%s\n",(double)
+      "# ImageMagick pixel debugging: %.17g,%.17g,%.17g,%s\n",(double)
       image->columns,(double) image->rows,(double) ((MagickOffsetType)
       GetQuantumRange(image->depth)),colorspace);
     (void) WriteBlobString(image,buffer);
@@ -223,18 +223,18 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info,
         break;
       for (x=0; x < (ssize_t) image->columns; x++)
       {
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g,%.20g: ",(double)
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g,%.17g: ",(double)
           x,(double) y);
         (void) WriteBlobString(image,buffer);
         GetPixelInfoPixel(image,p,&pixel);
-        (void) FormatLocaleString(tuple,MagickPathExtent,"%.20g,%.20g,%.20g ",
+        (void) FormatLocaleString(tuple,MagickPathExtent,"%.17g,%.17g,%.17g ",
           (double) pixel.red,(double) pixel.green,(double) pixel.blue);
         if (pixel.colorspace == CMYKColorspace)
           {
             char
               black[MagickPathExtent];

-            (void) FormatLocaleString(black,MagickPathExtent,",%.20g ",
+            (void) FormatLocaleString(black,MagickPathExtent,",%.17g ",
               (double) pixel.black);
             (void) ConcatenateMagickString(tuple,black,MagickPathExtent);
           }
@@ -243,7 +243,7 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info,
             char
               alpha[MagickPathExtent];

-            (void) FormatLocaleString(alpha,MagickPathExtent,",%.20g ",
+            (void) FormatLocaleString(alpha,MagickPathExtent,",%.17g ",
               (double) pixel.alpha);
             (void) ConcatenateMagickString(tuple,alpha,MagickPathExtent);
           }
diff --git a/coders/djvu.c b/coders/djvu.c
index d0627e59c..73b803cf0 100644
--- a/coders/djvu.c
+++ b/coders/djvu.c
@@ -658,7 +658,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,
                 image->depth =  8UL;    /* i only support that? */
         }
 #if DEBUG
-        printf("now filling %.20g x %.20g\n",(double) image->columns,(double)
+        printf("now filling %.17g x %.17g\n",(double) image->columns,(double)
           image->rows);
 #endif

@@ -688,7 +688,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,


 #if DEBUG
-        printf("END: finished filling %.20g x %.20g\n",(double) image->columns,
+        printf("END: finished filling %.17g x %.17g\n",(double) image->columns,
           (double) image->rows);
 #endif

diff --git a/coders/dpx.c b/coders/dpx.c
index efd5cc31b..3fa79037e 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -1025,17 +1025,17 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
       dpx.television.interlace=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.interlace != 0)
-        (void) FormatImageProperty(image,"dpx:television.interlace","%.20g",
+        (void) FormatImageProperty(image,"dpx:television.interlace","%.17g",
           (double) dpx.television.interlace);
       dpx.television.field_number=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.field_number != 0)
-        (void) FormatImageProperty(image,"dpx:television.field_number","%.20g",
+        (void) FormatImageProperty(image,"dpx:television.field_number","%.17g",
           (double) dpx.television.field_number);
       dpx.television.video_signal=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.video_signal != 0)
-        (void) FormatImageProperty(image,"dpx:television.video_signal","%.20g",
+        (void) FormatImageProperty(image,"dpx:television.video_signal","%.17g",
           (double) dpx.television.video_signal);
       dpx.television.padding=(unsigned char) ReadBlobByte(image);
       offset++;
diff --git a/coders/hdr.c b/coders/hdr.c
index 1f2b83cd2..bddcdf7bb 100644
--- a/coders/hdr.c
+++ b/coders/hdr.c
@@ -745,7 +745,7 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image,
   (void) WriteBlob(image,(size_t) count,(unsigned char *) header);
   length=CopyMagickString(header,"FORMAT=32-bit_rle_rgbe\n\n",MagickPathExtent);
   (void) WriteBlob(image,length,(unsigned char *) header);
-  count=FormatLocaleString(header,MagickPathExtent,"-Y %.20g +X %.20g\n",
+  count=FormatLocaleString(header,MagickPathExtent,"-Y %.17g +X %.17g\n",
     (double) image->rows,(double) image->columns);
   (void) WriteBlob(image,(size_t) count,(unsigned char *) header);
   /*
diff --git a/coders/heic.c b/coders/heic.c
index 788dd3ed6..cf584871d 100644
--- a/coders/heic.c
+++ b/coders/heic.c
@@ -1395,7 +1395,7 @@ static void WriteProfile(struct heif_context *context,Image *image,
       }
     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
+        "%s profile: %.17g bytes",name,(double) GetStringInfoLength(profile));
     name=GetNextImageProfile(image);
   }
   heif_image_handle_release(image_handle);
diff --git a/coders/html.c b/coders/html.c
index 18be81348..a1d93eaa4 100644
--- a/coders/html.c
+++ b/coders/html.c
@@ -375,7 +375,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
         {
           WriteHtmlEncodedString(image,image->filename);
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "\" shape=\"rect\" coords=\"0,0,%.20g,%.20g\" alt=\"\" />\n",
+            "\" shape=\"rect\" coords=\"0,0,%.17g,%.17g\" alt=\"\" />\n",
             (double) geometry.width-1,(double) geometry.height-1);
           (void) WriteBlobString(image,buffer);
         }
@@ -386,7 +386,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
           else
             {
               (void) FormatLocaleString(buffer,MagickPathExtent,"\" shape="
-                "\"rect\" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
+                "\"rect\" coords=\"%.17g,%.17g,%.17g,%.17g\" alt=\"\" />\n",
                 (double) geometry.x,(double) geometry.y,(double) (geometry.x+
                 (ssize_t) geometry.width-1),(double) (geometry.y+(ssize_t)
                 geometry.height-1));
@@ -452,7 +452,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
     {
       (void) WriteHtmlEncodedString(image,image->filename);
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "\" shape=\"rect\" coords=\"0,0,%.20g,%.20g\" alt=\"\" />\n",
+        "\" shape=\"rect\" coords=\"0,0,%.17g,%.17g\" alt=\"\" />\n",
         (double) geometry.width-1,(double) geometry.height-1);
       (void) WriteBlobString(image,buffer);
     }
@@ -463,7 +463,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
       else
         {
           (void) FormatLocaleString(buffer,MagickPathExtent,"\" shape=\"rect\""
-            " coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
+            " coords=\"%.17g,%.17g,%.17g,%.17g\" alt=\"\" />\n",
             (double) geometry.x,(double) geometry.y,geometry.x+(double)
             geometry.width-1,geometry.y+(double) geometry.height-1);
           (void) WriteBlobString(image,buffer);
diff --git a/coders/icon.c b/coders/icon.c
index 24ec665d6..8be917ef6 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -479,19 +479,19 @@ static Image *ReadICONImage(const ImageInfo *image_info,
         if (image->debug != MagickFalse)
           {
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              " scene    = %.20g",(double) i);
+              " scene    = %.17g",(double) i);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   size   = %.20g",(double) size);
+              "   size   = %.17g",(double) size);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   width  = %.20g",(double) image->columns);
+              "   width  = %.17g",(double) image->columns);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   height = %.20g",(double) image->rows);
+              "   height = %.17g",(double) image->rows);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   colors = %.20g",(double ) number_colors);
+              "   colors = %.17g",(double ) number_colors);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   planes = %.20g",(double) planes);
+              "   planes = %.17g",(double) planes);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   bpp    = %.20g",(double) bits_per_pixel);
+              "   bpp    = %.17g",(double) bits_per_pixel);
           }
       if ((number_colors != 0) || (bits_per_pixel <= 16U))
         {
diff --git a/coders/jnx.c b/coders/jnx.c
index e2d4ff0e9..b9a8f72e0 100644
--- a/coders/jnx.c
+++ b/coders/jnx.c
@@ -317,9 +317,9 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
       tile_image->depth=8;
       (void) CopyMagickString(tile_image->magick,image->magick,
         MagickPathExtent);
-      (void) FormatImageProperty(tile_image,"jnx:northeast","%.20g,%.20g",
+      (void) FormatImageProperty(tile_image,"jnx:northeast","%.17g,%.17g",
         northeast.x,northeast.y);
-      (void) FormatImageProperty(tile_image,"jnx:southwest","%.20g,%.20g",
+      (void) FormatImageProperty(tile_image,"jnx:southwest","%.17g,%.17g",
         southwest.x,southwest.y);
       AppendImageToList(&images,tile_image);
     }
diff --git a/coders/jpeg.c b/coders/jpeg.c
index 88b18463d..6f7158708 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -739,7 +739,7 @@ static MagickBooleanType ReadProfilePayload(j_decompress_ptr jpeg_info,
   *p='\0';
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "Profile[%.20g]: %.20g bytes",(double) index,(double) length);
+      "Profile[%.17g]: %.17g bytes",(double) index,(double) length);
   return(MagickTrue);
 }

@@ -1322,7 +1322,7 @@ static void JPEGSetImageQuality(const struct jpeg_decompress_struct *jpeg_info,
             image->quality=(size_t) i+1;
           if (image->debug != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "Quality: %.20g (%s)",(double) i+1,(qvalue <= hash[i]) &&
+              "Quality: %.17g (%s)",(double) i+1,(qvalue <= hash[i]) &&
               (sum <= sums[i]) ? "exact" : "approximate");
           break;
         }
@@ -1371,7 +1371,7 @@ static void JPEGSetImageQuality(const struct jpeg_decompress_struct *jpeg_info,
               image->quality=(size_t) i+1;
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "Quality: %.20g (%s)",(double) i+1,(qvalue <= hash[i]) &&
+                "Quality: %.17g (%s)",(double) i+1,(qvalue <= hash[i]) &&
                 (sum <= sums[i]) ? "exact" : "approximate");
             break;
           }
@@ -1730,7 +1730,7 @@ static Image *ReadOneJPEGImage(const ImageInfo *image_info,
       jpeg_calc_output_dimensions(jpeg_info);
       if (image->debug != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "Scale factor: %.20g",(double) scale_factor);
+          "Scale factor: %.17g",(double) scale_factor);
     }
 #if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED)
 #if !defined(LIBJPEG_TURBO_VERSION_NUMBER) && defined(D_LOSSLESS_SUPPORTED)
@@ -1870,7 +1870,7 @@ static Image *ReadOneJPEGImage(const ImageInfo *image_info,
     }
   JPEGSetImageQuality(jpeg_info,image);
   JPEGSetImageSamplingFactor(jpeg_info,image,exception);
-  (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double)
+  (void) FormatLocaleString(value,MagickPathExtent,"%.17g",(double)
     jpeg_info->out_color_space);
   (void) SetImageProperty(image,"jpeg:colorspace",value,exception);
 #if defined(D_ARITH_CODING_SUPPORTED)
@@ -2785,7 +2785,7 @@ static void WriteProfiles(j_compress_ptr jpeg_info,Image *image,
       }
     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
+        "%s profile: %.17g bytes",name,(double) GetStringInfoLength(profile));
     name=GetNextImageProfile(image);
   }
   custom_profile=DestroyStringInfo(custom_profile);
@@ -3045,7 +3045,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info,
     jpeg_set_colorspace(jpeg_info,JCS_YCCK);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "Image resolution: %.20g,%.20g",image->resolution.x,image->resolution.y);
+      "Image resolution: %.17g,%.17g",image->resolution.x,image->resolution.y);
   if ((image->resolution.x > 0) && (image->resolution.x < (double) SHRT_MAX) &&
       (image->resolution.y > 0) && (image->resolution.y < (double) SHRT_MAX))
     {
@@ -3155,7 +3155,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info,
       if (image->quality != UndefinedCompressionQuality)
         quality=(int) image->quality;
       if (image->debug != MagickFalse)
-        (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: %.20g",
+        (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: %.17g",
           (double) image->quality);
     }
   else
@@ -3405,11 +3405,11 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info,
       else
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "Storage class: DirectClass");
-      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Depth: %.20g",
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Depth: %.17g",
         (double) image->depth);
       if (image->colors != 0)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "Number of colors: %.20g",(double) image->colors);
+          "Number of colors: %.17g",(double) image->colors);
       else
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "Number of colors: unspecified");
diff --git a/coders/json.c b/coders/json.c
index 9ed118f8e..cc4c87739 100644
--- a/coders/json.c
+++ b/coders/json.c
@@ -608,8 +608,8 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image,
             break;
           if (n != 0)
             (void) FormatLocaleFile(file,",\n");
-          (void) FormatLocaleFile(file,"        \"location%.20g\": {\n"
-            "          \"x\": %.20g,\n          \"y\": %.20g\n"
+          (void) FormatLocaleFile(file,"        \"location%.17g\": {\n"
+            "          \"x\": %.17g,\n          \"y\": %.17g\n"
             "        }",(double) n,(double) x,(double) y);
           n++;
         }
@@ -653,9 +653,9 @@ static ssize_t PrintChannelMoments(FILE *file,const PixelChannel channel,
   n+=FormatLocaleFile(file,"        \"ellipseIntensity\": %.*g,\n",
     GetMagickPrecision(),channel_moments[channel].ellipse_intensity);
   for (i=0; i < 7; i++)
-    n+=FormatLocaleFile(file,"        \"I%.20g\": %.*g,\n",i+1.0,
+    n+=FormatLocaleFile(file,"        \"I%.17g\": %.*g,\n",i+1.0,
       GetMagickPrecision(),channel_moments[channel].invariant[i]);
-  n+=FormatLocaleFile(file,"        \"I%.20g\": %.*g\n",i+1.0,
+  n+=FormatLocaleFile(file,"        \"I%.17g\": %.*g\n",i+1.0,
     GetMagickPrecision(),channel_moments[channel].invariant[i]);
   (void) FormatLocaleFile(file,"      }");
   if (separator != MagickFalse)
@@ -691,13 +691,13 @@ static ssize_t PrintChannelPerceptualHash(Image *image,FILE *file,
     PixelTrait traits = GetPixelChannelTraits(image,channel);
     if (traits == UndefinedPixelTrait)
       continue;
-    n=FormatLocaleFile(file,"      \"Channel%.20g\": {\n",(double) channel);
+    n=FormatLocaleFile(file,"      \"Channel%.17g\": {\n",(double) channel);
     for (j=0; j < MaximumNumberOfPerceptualHashes; j++)
     {
       ssize_t
         k;

-      n+=FormatLocaleFile(file,"        \"PH%.20g\": [",(double) j+1);
+      n+=FormatLocaleFile(file,"        \"PH%.17g\": [",(double) j+1);
       for (k=0; k < (ssize_t) channel_phash[0].number_colorspaces; k++)
       {
         n+=FormatLocaleFile(file,"%.*g",GetMagickPrecision(),
@@ -906,7 +906,7 @@ static void EncodeIptcProfile(FILE *file,const StringInfo *profile)
       for (i=0; i < (ssize_t) count; i++)
       {
         value=values[i];
-        (void) FormatLocaleFile(file,"        \"%s[%.20g,%.20g]\": ",
+        (void) FormatLocaleFile(file,"        \"%s[%.17g,%.17g]\": ",
           value->tag,(double) value->dataset,(double) value->record);
         if (value->values_length == 0)
           (void) FormatLocaleFile(file,"null,");
@@ -1183,37 +1183,37 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
     image->depth);
   (void) FormatLocaleFile(file,"    \"channelDepth\": {\n");
   if (image->alpha_trait != UndefinedPixelTrait)
-    (void) FormatLocaleFile(file,"      \"alpha\": %.20g,\n",(double)
+    (void) FormatLocaleFile(file,"      \"alpha\": %.17g,\n",(double)
       channel_statistics[AlphaPixelChannel].depth);
   switch (image->colorspace)
   {
     case RGBColorspace:
     default:
     {
-      (void) FormatLocaleFile(file,"      \"red\": %.20g,\n",(double)
+      (void) FormatLocaleFile(file,"      \"red\": %.17g,\n",(double)
         channel_statistics[RedChannel].depth);
-      (void) FormatLocaleFile(file,"      \"green\": %.20g,\n",(double)
+      (void) FormatLocaleFile(file,"      \"green\": %.17g,\n",(double)
         channel_statistics[GreenChannel].depth);
-      (void) FormatLocaleFile(file,"      \"blue\": %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      \"blue\": %.17g\n",(double)
         channel_statistics[BlueChannel].depth);
       break;
     }
     case CMYKColorspace:
     {
-      (void) FormatLocaleFile(file,"      \"cyan\": %.20g,\n",(double)
+      (void) FormatLocaleFile(file,"      \"cyan\": %.17g,\n",(double)
         channel_statistics[CyanChannel].depth);
-      (void) FormatLocaleFile(file,"      \"magenta\": %.20g,\n",(double)
+      (void) FormatLocaleFile(file,"      \"magenta\": %.17g,\n",(double)
         channel_statistics[MagentaChannel].depth);
-      (void) FormatLocaleFile(file,"      \"yellow\": %.20g,\n",(double)
+      (void) FormatLocaleFile(file,"      \"yellow\": %.17g,\n",(double)
         channel_statistics[YellowChannel].depth);
-      (void) FormatLocaleFile(file,"      \"black\": %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      \"black\": %.17g\n",(double)
         channel_statistics[BlackChannel].depth);
       break;
     }
     case LinearGRAYColorspace:
     case GRAYColorspace:
     {
-      (void) FormatLocaleFile(file,"      \"gray\": %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      \"gray\": %.17g\n",(double)
         channel_statistics[GrayChannel].depth);
       break;
     }
@@ -1225,7 +1225,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
       MAGICKCORE_QUANTUM_DEPTH-image->depth)));
   if (channel_statistics != (ChannelStatistics *) NULL)
     {
-      (void) FormatLocaleFile(file,"    \"pixels\": %.20g,\n",
+      (void) FormatLocaleFile(file,"    \"pixels\": %.17g,\n",
         channel_statistics[CompositePixelChannel].area);
       if ((image->colorspace != LinearGRAYColorspace) &&
           (image->colorspace != GRAYColorspace))
@@ -1411,7 +1411,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
       PixelInfo
         *magick_restrict p;

-      (void) FormatLocaleFile(file,"    \"colormapEntries\": %.20g,\n",
+      (void) FormatLocaleFile(file,"    \"colormapEntries\": %.17g,\n",
         (double) image->colors);
       (void) FormatLocaleFile(file,"    \"colormap\": [\n      ");
       p=image->colormap;
@@ -1467,8 +1467,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
     }
   if ((image->extract_info.width*image->extract_info.height) != 0)
     (void) FormatLocaleFile(file,"    \"tileGeometry\": {\n"
-      "      \"width\": %.20g,\n      \"height\": %.20g,\n"
-      "      \"x\": %.20g,\n      \"y\": %.20g\n    },\n",
+      "      \"width\": %.17g,\n      \"height\": %.17g,\n"
+      "      \"x\": %.17g,\n      \"y\": %.17g\n    },\n",
       (double) image->extract_info.width,(double) image->extract_info.height,
       (double) image->extract_info.x,(double) image->extract_info.y);
   GetColorTuple(&image->matte_color,MagickTrue,color);
@@ -1488,8 +1488,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
   if ((image->page.width != 0) || (image->page.height != 0) ||
       (image->page.x != 0) || (image->page.y != 0))
     (void) FormatLocaleFile(file,"    \"pageGeometry\": {\n"
-      "      \"width\": %.20g,\n      \"height\": %.20g,\n"
-      "      \"x\": %.20g,\n      \"y\": %.20g\n    },\n",
+      "      \"width\": %.17g,\n      \"height\": %.17g,\n"
+      "      \"x\": %.17g,\n      \"y\": %.17g\n    },\n",
       (double) image->page.width,(double) image->page.height,
       (double) image->page.x,(double) image->page.y);
   if ((image->page.x != 0) || (image->page.y != 0))
@@ -1498,23 +1498,23 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
   JSONFormatLocaleFile(file,"    \"dispose\": %s,\n",
     CommandOptionToMnemonic(MagickDisposeOptions,(ssize_t) image->dispose));
   if (image->delay != 0)
-    (void) FormatLocaleFile(file,"    \"delay\": \"%.20gx%.20g\",\n",
+    (void) FormatLocaleFile(file,"    \"delay\": \"%.17gx%.17g\",\n",
       (double) image->delay,(double) image->ticks_per_second);
   if (image->iterations != 1)
-    (void) FormatLocaleFile(file,"    \"iterations\": %.20g,\n",(double)
+    (void) FormatLocaleFile(file,"    \"iterations\": %.17g,\n",(double)
       image->iterations);
   if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
-    (void) FormatLocaleFile(file,"    \"scene\": %.20g,\n    \"scenes\": "
-      "%.20g,\n",(double) image->scene,(double) GetImageListLength(image));
+    (void) FormatLocaleFile(file,"    \"scene\": %.17g,\n    \"scenes\": "
+      "%.17g,\n",(double) image->scene,(double) GetImageListLength(image));
   else
     if (image->scene != 0)
-      (void) FormatLocaleFile(file,"    \"scene\": %.20g,\n",(double)
+      (void) FormatLocaleFile(file,"    \"scene\": %.17g,\n",(double)
         image->scene);
   JSONFormatLocaleFile(file,"    \"compression\": %s,\n",
     CommandOptionToMnemonic(MagickCompressOptions,(ssize_t)
     image->compression));
   if (image->quality != UndefinedCompressionQuality)
-    (void) FormatLocaleFile(file,"    \"quality\": %.20g,\n",(double)
+    (void) FormatLocaleFile(file,"    \"quality\": %.17g,\n",(double)
       image->quality);
   JSONFormatLocaleFile(file,"    \"orientation\": %s,\n",
     CommandOptionToMnemonic(MagickOrientationOptions,(ssize_t)
@@ -1560,7 +1560,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
             (void) FormatLocaleFile(file,"    }");
             continue;
           }
-        (void) FormatLocaleFile(file,",\n       \"info\": \"%.20gx%.20g %s\"",
+        (void) FormatLocaleFile(file,",\n       \"info\": \"%.17gx%.17g %s\"",
           (double) tile->magick_columns,(double) tile->magick_rows,
           tile->magick);
         (void) SignatureImage(tile,exception);
@@ -1639,7 +1639,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
         JSONFormatLocaleFile(file,"      %s: {\n",name);
         if (LocaleCompare(name,"iptc") == 0)
           EncodeIptcProfile(file,profile);
-        (void) FormatLocaleFile(file,"        \"length\": %.20g",(double)
+        (void) FormatLocaleFile(file,"        \"length\": %.17g",(double)
           GetStringInfoLength(profile));
         (void) FormatLocaleFile(file,"\n      }");
         name=GetNextImageProfile(image);
diff --git a/coders/label.c b/coders/label.c
index 1b879bc05..12b85d812 100644
--- a/coders/label.c
+++ b/coders/label.c
@@ -324,7 +324,7 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
   (void) CloneString(&draw_info->geometry,geometry);
   status=AnnotateImage(image,draw_info,exception);
   if (image_info->pointsize == 0.0)
-    (void) FormatImageProperty(image,"label:pointsize","%.20g",
+    (void) FormatImageProperty(image,"label:pointsize","%.17g",
       draw_info->pointsize);
   draw_info=DestroyDrawInfo(draw_info);
   if (status == MagickFalse)
diff --git a/coders/mat.c b/coders/mat.c
index 6cc658af8..cf04efa04 100644
--- a/coders/mat.c
+++ b/coders/mat.c
@@ -1141,7 +1141,7 @@ MATLAB_KO:
     CellType = ReadBlobXXXLong(image2);    /* Additional object type */
     if (logging)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "MATLAB_HDR.CellType: %.20g",(double) CellType);
+        "MATLAB_HDR.CellType: %.17g",(double) CellType);

     /* data size */
     if (ReadBlob(image2, 4, (unsigned char *) &size) != 4)
diff --git a/coders/miff.c b/coders/miff.c
index e9550fb15..5f8bd4a92 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -2210,20 +2210,20 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
     */
     (void) WriteBlobString(image,"id=ImageMagick version=1.0\n");
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "class=%s colors=%.20g alpha-trait=%s\n",CommandOptionToMnemonic(
+      "class=%s colors=%.17g alpha-trait=%s\n",CommandOptionToMnemonic(
       MagickClassOptions,image->storage_class),(double) image->colors,
       CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t)
       image->alpha_trait));
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent, "number-channels=%.20g "
-      "number-meta-channels=%.20g channel-mask=0x%016llx\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent, "number-channels=%.17g "
+      "number-meta-channels=%.17g channel-mask=0x%016llx\n",
       (double) image->number_channels,(double) image->number_meta_channels,
       (MagickOffsetType) image->channel_mask);
     (void) WriteBlobString(image,buffer);
     if (image->alpha_trait != UndefinedPixelTrait)
       (void) WriteBlobString(image,"matte=True\n");
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "columns=%.20g rows=%.20g depth=%.20g\n",(double) image->columns,
+      "columns=%.17g rows=%.17g depth=%.17g\n",(double) image->columns,
       (double) image->rows,(double) image->depth);
     (void) WriteBlobString(image,buffer);
     if (image->type != UndefinedType)
@@ -2254,7 +2254,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
     if (compression != UndefinedCompression)
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,"compression=%s  "
-          "quality=%.20g\n",CommandOptionToMnemonic(MagickCompressOptions,
+          "quality=%.17g\n",CommandOptionToMnemonic(MagickCompressOptions,
           compression),(double) image->quality);
         (void) WriteBlobString(image,buffer);
       }
@@ -2273,7 +2273,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
     if ((image->page.width != 0) || (image->page.height != 0))
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "page=%.20gx%.20g%+.20g%+.20g\n",(double) image->page.width,(double)
+          "page=%.17gx%.17g%+.20g%+.20g\n",(double) image->page.width,(double)
           image->page.height,(double) image->page.x,(double) image->page.y);
         (void) WriteBlobString(image,buffer);
       }
@@ -2295,12 +2295,12 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
         (GetPreviousImageInList(image) != (Image *) NULL))
       {
         if (image->scene == 0)
-          (void) FormatLocaleString(buffer,MagickPathExtent,"iterations=%.20g "
-            "delay=%.20g ticks-per-second=%.20g\n",(double) image->iterations,
+          (void) FormatLocaleString(buffer,MagickPathExtent,"iterations=%.17g "
+            "delay=%.17g ticks-per-second=%.17g\n",(double) image->iterations,
             (double) image->delay,(double) image->ticks_per_second);
         else
-          (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.20g  "
-            "iterations=%.20g delay=%.20g ticks-per-second=%.20g\n",(double)
+          (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.17g  "
+            "iterations=%.17g delay=%.17g ticks-per-second=%.17g\n",(double)
             image->scene,(double) image->iterations,(double) image->delay,
             (double) image->ticks_per_second);
         (void) WriteBlobString(image,buffer);
@@ -2309,26 +2309,26 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
       {
         if (image->scene != 0)
           {
-            (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.20g\n",
+            (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.17g\n",
               (double) image->scene);
             (void) WriteBlobString(image,buffer);
           }
         if (image->iterations != 0)
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "iterations=%.20g\n",(double) image->iterations);
+              "iterations=%.17g\n",(double) image->iterations);
             (void) WriteBlobString(image,buffer);
           }
         if (image->delay != 0)
           {
-            (void) FormatLocaleString(buffer,MagickPathExtent,"delay=%.20g\n",
+            (void) FormatLocaleString(buffer,MagickPathExtent,"delay=%.17g\n",
               (double) image->delay);
             (void) WriteBlobString(image,buffer);
           }
         if (image->ticks_per_second != UndefinedTicksPerSecond)
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "ticks-per-second=%.20g\n",(double) image->ticks_per_second);
+              "ticks-per-second=%.17g\n",(double) image->ticks_per_second);
             (void) WriteBlobString(image,buffer);
           }
       }
diff --git a/coders/mpc.c b/coders/mpc.c
index 52af74714..105f25789 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -1209,18 +1209,18 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
     nonce=DestroyStringInfo(nonce);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "class=%s colors=%.20g alpha-trait=%s\n",CommandOptionToMnemonic(
+      "class=%s colors=%.17g alpha-trait=%s\n",CommandOptionToMnemonic(
       MagickClassOptions,image->storage_class),(double) image->colors,
       CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t)
       image->alpha_trait));
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"number-channels=%.20g "
-      "number-meta-channels=%.20g channel-mask=0x%016llx\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"number-channels=%.17g "
+      "number-meta-channels=%.17g channel-mask=0x%016llx\n",
       (double) image->number_channels,(double) image->number_meta_channels,
       (MagickOffsetType) image->channel_mask);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "columns=%.20g rows=%.20g depth=%.20g\n",(double) image->columns,
+      "columns=%.17g rows=%.17g depth=%.17g\n",(double) image->columns,
       (double) image->rows,(double) image->depth);
     (void) WriteBlobString(image,buffer);
     if (image->type != UndefinedType)
@@ -1248,7 +1248,7 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
     if (image->compression != UndefinedCompression)
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "compression=%s quality=%.20g\n",CommandOptionToMnemonic(
+          "compression=%s quality=%.17g\n",CommandOptionToMnemonic(
           MagickCompressOptions,image->compression),(double) image->quality);
         (void) WriteBlobString(image,buffer);
       }
@@ -1267,7 +1267,7 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
     if ((image->page.width != 0) || (image->page.height != 0))
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "page=%.20gx%.20g%+.20g%+.20g\n",(double) image->page.width,(double)
+          "page=%.17gx%.17g%+.20g%+.20g\n",(double) image->page.width,(double)
           image->page.height,(double) image->page.x,(double) image->page.y);
         (void) WriteBlobString(image,buffer);
       }
@@ -1290,12 +1290,12 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
       {
         if (image->scene == 0)
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "iterations=%.20g delay=%.20g  ticks-per-second=%.20g\n",(double)
+            "iterations=%.17g delay=%.17g  ticks-per-second=%.17g\n",(double)
             image->iterations,(double) image->delay,(double)
             image->ticks_per_second);
         else
-          (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.20g  "
-            "iterations=%.20g delay=%.20g  ticks-per-second=%.20g\n",
+          (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.17g  "
+            "iterations=%.17g delay=%.17g  ticks-per-second=%.17g\n",
             (double) image->scene,(double) image->iterations,(double)
             image->delay,(double) image->ticks_per_second);
         (void) WriteBlobString(image,buffer);
@@ -1304,26 +1304,26 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
       {
         if (image->scene != 0)
           {
-            (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.20g\n",
+            (void) FormatLocaleString(buffer,MagickPathExtent,"scene=%.17g\n",
               (double) image->scene);
             (void) WriteBlobString(image,buffer);
           }
         if (image->iterations != 0)
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "iterations=%.20g\n",(double) image->iterations);
+              "iterations=%.17g\n",(double) image->iterations);
             (void) WriteBlobString(image,buffer);
           }
         if (image->delay != 0)
           {
-            (void) FormatLocaleString(buffer,MagickPathExtent,"delay=%.20g\n",
+            (void) FormatLocaleString(buffer,MagickPathExtent,"delay=%.17g\n",
               (double) image->delay);
             (void) WriteBlobString(image,buffer);
           }
         if (image->ticks_per_second != UndefinedTicksPerSecond)
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "ticks-per-second=%.20g\n",(double) image->ticks_per_second);
+              "ticks-per-second=%.17g\n",(double) image->ticks_per_second);
             (void) WriteBlobString(image,buffer);
           }
       }
diff --git a/coders/msl.c b/coders/msl.c
index ee7a494ce..8fd204593 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -775,7 +775,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           (void) FormatLocaleString(text,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+            "%.17gx%.17g%+.20g%+.20g",(double) geometry.width,(double)
             geometry.height,(double) geometry.x,(double) geometry.y);
           CloneString(&draw_info->geometry,text);
           draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
@@ -1793,7 +1793,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             }
           image=msl_info->image[n];
           (void) FormatLocaleString(composite_geometry,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,
+            "%.17gx%.17g%+.20g%+.20g",(double) composite_image->columns,
             (double) composite_image->rows,(double) geometry.x,(double)
             geometry.y);
           flags=ParseGravityGeometry(image,composite_geometry,&geometry,
@@ -2425,7 +2425,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           (void) FormatLocaleString(text,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+            "%.17gx%.17g%+.20g%+.20g",(double) geometry.width,(double)
             geometry.height,(double) geometry.x,(double) geometry.y);
           CloneString(&draw_info->geometry,text);
           draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
@@ -3023,7 +3023,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               {
                 if (LocaleCompare(keyword,"height") == 0)
                   {
-                    (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+                    (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
                       (double) msl_info->image[n]->rows);
                     (void) SetImageProperty(msl_info->attributes[n],key,value,
                       exception);
@@ -3037,7 +3037,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               {
                 if (LocaleCompare(keyword,"width") == 0)
                   {
-                    (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
+                    (void) FormatLocaleString(value,MagickPathExtent,"%.17g",
                       (double) msl_info->image[n]->columns);
                     (void) SetImageProperty(msl_info->attributes[n],key,value,
                       exception);
@@ -4625,7 +4625,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           (void) FormatLocaleString(text,MagickPathExtent,
-            "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+            "%.17gx%.17g%+.20g%+.20g",(double) geometry.width,(double)
             geometry.height,(double) geometry.x,(double) geometry.y);
           CloneString(&draw_info->geometry,text);
           draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
@@ -5898,11 +5898,11 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 if (image_option != (const char *) NULL)
                   flags=ParseAbsoluteGeometry(image_option,&page_geometry);
                 flags=ParseAbsoluteGeometry(value,&page_geometry);
-                (void) FormatLocaleString(page,MagickPathExtent,"%.20gx%.20g",
+                (void) FormatLocaleString(page,MagickPathExtent,"%.17gx%.17g",
                   (double) page_geometry.width,(double) page_geometry.height);
                 if (((flags & XValue) != 0) || ((flags & YValue) != 0))
                   (void) FormatLocaleString(page,MagickPathExtent,
-                    "%.20gx%.20g%+.20g%+.20g",(double) page_geometry.width,
+                    "%.17gx%.17g%+.20g%+.20g",(double) page_geometry.width,
                     (double) page_geometry.height,(double) page_geometry.x,
                     (double) page_geometry.y);
                 (void) SetImageOption(msl_info->image_info[n],keyword,page);
diff --git a/coders/mtv.c b/coders/mtv.c
index ea03a69ad..11e8e0402 100644
--- a/coders/mtv.c
+++ b/coders/mtv.c
@@ -385,7 +385,7 @@ static MagickBooleanType WriteMTVImage(const ImageInfo *image_info,Image *image,
     /*
       Initialize raster file header.
     */
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g %.17g\n",(double)
       image->columns,(double) image->rows);
     (void) WriteBlobString(image,buffer);
     for (y=0; y < (ssize_t) image->rows; y++)
diff --git a/coders/pcl.c b/coders/pcl.c
index f6703575a..10c8b7271 100644
--- a/coders/pcl.c
+++ b/coders/pcl.c
@@ -314,7 +314,7 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
     (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
   if (image_info->page != (char *) NULL)
     (void) ParseAbsoluteGeometry(image_info->page,&page);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",(double)
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%.17gx%.17g",(double)
     page.width,(double) page.height);
   if (image_info->monochrome != MagickFalse)
     delegate_info=GetDelegateInfo("pcl:mono",(char *) NULL,exception);
@@ -340,7 +340,7 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
     (void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0");
   page.width=CastDoubleToSizeT(page.width*image->resolution.x/delta.x+0.5);
   page.height=CastDoubleToSizeT(page.height*image->resolution.y/delta.y+0.5);
-  (void) FormatLocaleString(options,MagickPathExtent,"-g%.20gx%.20g ",(double)
+  (void) FormatLocaleString(options,MagickPathExtent,"-g%.17gx%.17g ",(double)
     page.width,(double) page.height);
   image=DestroyImage(image);
   read_info=CloneImageInfo(image_info);
@@ -348,11 +348,11 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if (read_info->number_scenes != 0)
     {
       if (read_info->number_scenes != 1)
-        (void) FormatLocaleString(options,MagickPathExtent,"-dLastPage=%.20g",
+        (void) FormatLocaleString(options,MagickPathExtent,"-dLastPage=%.17g",
           (double) (read_info->scene+read_info->number_scenes));
       else
         (void) FormatLocaleString(options,MagickPathExtent,
-          "-dFirstPage=%.20g -dLastPage=%.20g",(double) read_info->scene+1,
+          "-dFirstPage=%.17g -dLastPage=%.17g",(double) read_info->scene+1,
           (double) (read_info->scene+read_info->number_scenes));
       read_info->number_scenes=0;
       if (read_info->scenes != (char *) NULL)
@@ -748,10 +748,10 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
       (void) TransformImageColorspace(image,sRGBColorspace,exception);
     (void) WriteBlobString(image,"\033E");  /* printer reset */
     (void) WriteBlobString(image,"\033*r3F");  /* set presentation mode */
-    (void) FormatLocaleString(buffer,MagickPathExtent,"\033*r%.20gs%.20gT",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"\033*r%.17gs%.17gT",
       (double) image->columns,(double) image->rows);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"\033*t%.20gR",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"\033*t%.17gR",(double)
       density);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"\033&l0E");  /* top margin 0 */
@@ -793,7 +793,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
           for (i=0; i < (ssize_t) image->colors; i++)
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "\033*v%da%db%dc%.20gI",
+              "\033*v%da%db%dc%.17gI",
               ScaleQuantumToChar((Quantum) image->colormap[i].red),
               ScaleQuantumToChar((Quantum) image->colormap[i].green),
               ScaleQuantumToChar((Quantum) image->colormap[i].blue),(double) i);
@@ -801,7 +801,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
           }
           for (one=1; i < (ssize_t) (one << bits_per_pixel); i++)
           {
-            (void) FormatLocaleString(buffer,MagickPathExtent,"\033*v%.20gI",
+            (void) FormatLocaleString(buffer,MagickPathExtent,"\033*v%.17gI",
               (double) i);
             (void) WriteBlobString(image,buffer);
           }
@@ -942,7 +942,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
       {
         case NoCompression:
         {
-          (void) FormatLocaleString(buffer,MagickPathExtent,"\033*b%.20gW",
+          (void) FormatLocaleString(buffer,MagickPathExtent,"\033*b%.17gW",
             (double) length);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,length,pixels);
@@ -951,7 +951,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
         case RLECompression:
         {
           packets=PCLPackbitsCompressImage(length,pixels,compress_pixels);
-          (void) FormatLocaleString(buffer,MagickPathExtent,"\033*b%.20gW",
+          (void) FormatLocaleString(buffer,MagickPathExtent,"\033*b%.17gW",
             (double) packets);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,packets,compress_pixels);
@@ -964,7 +964,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
               previous_pixels[i]=(~pixels[i]);
           packets=PCLDeltaCompressImage(length,previous_pixels,pixels,
             compress_pixels);
-          (void) FormatLocaleString(buffer,MagickPathExtent,"\033*b%.20gW",
+          (void) FormatLocaleString(buffer,MagickPathExtent,"\033*b%.17gW",
             (double) packets);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,packets,compress_pixels);
diff --git a/coders/pdf.c b/coders/pdf.c
index c17814f75..43121287c 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -300,7 +300,7 @@ static void ReadPDFInfo(const ImageInfo *image_info,Image *image,
           Note spot names.
         */
         (void) FormatLocaleString(property,MagickPathExtent,
-          "pdf:SpotColor-%.20g",(double) spotcolor++);
+          "pdf:SpotColor-%.17g",(double) spotcolor++);
         i=0;
         SkipMagickByteBuffer(&buffer,strlen(SpotColor)+1);
         for (c=ReadMagickByteBuffer(&buffer); c != EOF; c=ReadMagickByteBuffer(&buffer))
@@ -597,7 +597,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
     (void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0");
   else
     if ((image_info->page != (char *) NULL) || (fitPage != MagickFalse))
-      (void) FormatLocaleString(options,MagickPathExtent,"-g%.20gx%.20g ",
+      (void) FormatLocaleString(options,MagickPathExtent,"-g%.17gx%.17g ",
         (double) page.width,(double) page.height);
   option=GetImageOption(image_info,"pdf:printed");
   if (IsStringTrue(option) != MagickFalse)
@@ -639,8 +639,8 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
       char
         pages[MagickPathExtent];

-      (void) FormatLocaleString(pages,MagickPathExtent,"-dFirstPage=%.20g "
-        "-dLastPage=%.20g",(double) read_info->scene+1,(double)
+      (void) FormatLocaleString(pages,MagickPathExtent,"-dFirstPage=%.17g "
+        "-dLastPage=%.17g",(double) read_info->scene+1,(double)
         (read_info->scene+read_info->number_scenes));
       (void) ConcatenateMagickString(options,pages,MagickPathExtent);
       read_info->number_scenes=0;
@@ -1632,19 +1632,19 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
   */
   xref[object++]=TellBlob(image);
   root_id=object;
-  (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
     object);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"<<\n");
   if (is_pdfa == MagickFalse)
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Pages %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Pages %.17g 0 R\n",
       (double) object+1);
   else
     {
-      (void) FormatLocaleString(buffer,MagickPathExtent,"/Metadata %.20g 0 R\n",
+      (void) FormatLocaleString(buffer,MagickPathExtent,"/Metadata %.17g 0 R\n",
         (double) object+1);
       (void) WriteBlobString(image,buffer);
-      (void) FormatLocaleString(buffer,MagickPathExtent,"/Pages %.20g 0 R\n",
+      (void) FormatLocaleString(buffer,MagickPathExtent,"/Pages %.17g 0 R\n",
         (double) object+2);
     }
   (void) WriteBlobString(image,buffer);
@@ -1672,7 +1672,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         Write XMP object.
       */
       xref[object++]=TellBlob(image);
-      (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+      (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
         object);
       (void) WriteBlobString(image,buffer);
       (void) WriteBlobString(image,"<<\n");
@@ -1692,7 +1692,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       title=DestroyString(title);
       creator=DestroyString(creator);
       keywords=DestroyString(keywords);
-      (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g\n",
+      (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.17g\n",
         (double) i);
       (void) WriteBlobString(image,buffer);
       (void) WriteBlobString(image,"/Type /Metadata\n");
@@ -1706,12 +1706,12 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
   */
   xref[object++]=TellBlob(image);
   pages_id=object;
-  (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
     object);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"<<\n");
   (void) WriteBlobString(image,"/Type /Pages\n");
-  (void) FormatLocaleString(buffer,MagickPathExtent,"/Kids [ %.20g 0 R ",
+  (void) FormatLocaleString(buffer,MagickPathExtent,"/Kids [ %.17g 0 R ",
     (double) object+1);
   (void) WriteBlobString(image,buffer);
   count=(ssize_t) (pages_id+ObjectsPerImage+1);
@@ -1731,7 +1731,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         icc_profile=GetCompatibleColorProfile(kid_image);
         if (icc_profile != (StringInfo *) NULL)
           count+=2;
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 R ",(double)
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 R ",(double)
           count);
         (void) WriteBlobString(image,buffer);
         kid_image=GetNextImageInList(kid_image);
@@ -1742,7 +1742,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
     }
   (void) WriteBlobString(image,"]\n");
-  (void) FormatLocaleString(buffer,MagickPathExtent,"/Count %.20g\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"/Count %.17g\n",(double)
     page_count);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,">>\n");
@@ -1850,14 +1850,14 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         resolution.y=(double) ((size_t) (100.0*2.54*resolution.y+0.5)/100.0);
       }
     SetGeometry(image,&geometry);
-    (void) FormatLocaleString(temp,MagickPathExtent,"%.20gx%.20g",
+    (void) FormatLocaleString(temp,MagickPathExtent,"%.17gx%.17g",
       (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(temp,image_info->page,MagickPathExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
         (void) FormatLocaleString(temp,MagickPathExtent,
-          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+          "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,(double)
           image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
@@ -1891,12 +1891,12 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Page object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
     (void) WriteBlobString(image,"/Type /Page\n");
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Parent %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Parent %.17g 0 R\n",
       (double) pages_id);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"/Resources <<\n");
@@ -1907,15 +1907,15 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
     if (labels != (char **) NULL)
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "/Font << /F%.20g %.20g 0 R >>\n",(double) image->scene,(double)
+          "/Font << /F%.17g %.17g 0 R >>\n",(double) image->scene,(double)
           object+4);
         (void) WriteBlobString(image,buffer);
       }
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "/XObject << /Im%.20g %.20g 0 R >>\n",(double) image->scene,(double)
+      "/XObject << /Im%.17g %.17g 0 R >>\n",(double) image->scene,(double)
       object+5);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/ProcSet %.20g 0 R >>\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/ProcSet %.17g 0 R >>\n",
       (double) object+3);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
@@ -1928,10 +1928,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       MagickSafeReciprocal(resolution.x),(double) (DefaultResolution*
       media_info.height*MagickSafeReciprocal(resolution.y)));
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Contents %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Contents %.17g 0 R\n",
       (double) object+1);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Thumb %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Thumb %.17g 0 R\n",
       (double) object+(icc_profile != (StringInfo *) NULL ? 10 : 8));
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
@@ -1940,11 +1940,11 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Contents object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.17g 0 R\n",
       (double) object+1);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
@@ -1955,10 +1955,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       for (i=0; labels[i] != (char *) NULL; i++)
       {
         (void) WriteBlobString(image,"BT\n");
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/F%.20g %g Tf\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/F%.17g %g Tf\n",
           (double) image->scene,pointsize);
         (void) WriteBlobString(image,buffer);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g Td\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g %.17g Td\n",
           (double) geometry.x,(double) (geometry.y+(ssize_t) geometry.height+
           i*pointsize+12));
         (void) WriteBlobString(image,buffer);
@@ -1969,10 +1969,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         labels[i]=DestroyString(labels[i]);
       }
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "%g 0 0 %g %.20g %.20g cm\n",scale.x,scale.y,(double) geometry.x,
+      "%g 0 0 %g %.17g %.17g cm\n",scale.x,scale.y,(double) geometry.x,
       (double) geometry.y);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Im%.20g Do\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Im%.17g Do\n",(double)
       image->scene);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"Q\n");
@@ -1983,10 +1983,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
       offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
@@ -1994,7 +1994,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Procset object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     if ((compression == FaxCompression) || (compression == Group4Compression))
@@ -2011,7 +2011,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Font object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
@@ -2019,7 +2019,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       {
         (void) WriteBlobString(image,"/Type /Font\n");
         (void) WriteBlobString(image,"/Subtype /Type1\n");
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/Name /F%.20g\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/Name /F%.17g\n",
           (double) image->scene);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"/BaseFont /Helvetica\n");
@@ -2032,13 +2032,13 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write XObject object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
     (void) WriteBlobString(image,"/Type /XObject\n");
     (void) WriteBlobString(image,"/Subtype /Image\n");
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Name /Im%.20g\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Name /Im%.17g\n",
       (double) image->scene);
     (void) WriteBlobString(image,buffer);
     switch (compression)
@@ -2087,7 +2087,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           MagickPathExtent);
         (void) WriteBlobString(image,buffer);
         (void) FormatLocaleString(buffer,MagickPathExtent,"/DecodeParms [ << "
-          "/K %s /BlackIs1 false /Columns %.20g /Rows %.20g >> ]\n",CCITTParam,
+          "/K %s /BlackIs1 false /Columns %.17g /Rows %.17g >> ]\n",CCITTParam,
           (double) image->columns,(double) image->rows);
         break;
       }
@@ -2099,13 +2099,13 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       }
     }
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Width %.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Width %.17g\n",(double)
       image->columns);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Height %.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Height %.17g\n",(double)
       image->rows);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/ColorSpace %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/ColorSpace %.17g 0 R\n",
       (double) object+2);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,"/BitsPerComponent %d\n",
@@ -2114,11 +2114,11 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
     (void) WriteBlobString(image,buffer);
     if (image->alpha_trait != UndefinedPixelTrait)
       {
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/SMask %.20g 0 R\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/SMask %.17g 0 R\n",
           (double) object+(icc_profile != (StringInfo *) NULL ? 9 : 7));
         (void) WriteBlobString(image,buffer);
       }
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.17g 0 R\n",
       (double) object+1);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
@@ -2467,10 +2467,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
       offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
@@ -2478,7 +2478,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Colorspace object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     device="DeviceRGB";
@@ -2507,7 +2507,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           (void) FormatLocaleString(buffer,MagickPathExtent,"/%s\n",device);
         else
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "[ /Indexed /%s %.20g %.20g 0 R ]\n",device,(double) image->colors-1,
+            "[ /Indexed /%s %.17g %.17g 0 R ]\n",device,(double) image->colors-1,
             (double) object+3);
         (void) WriteBlobString(image,buffer);
       }
@@ -2520,15 +2520,15 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           Write ICC profile.
         */
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "[/ICCBased %.20g 0 R]\n",(double) object+1);
+          "[/ICCBased %.17g 0 R]\n",(double) object+1);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"endobj\n");
         xref[object++]=TellBlob(image);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",
           (double) object);
         (void) WriteBlobString(image,buffer);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"<<\n/N %.20g\n"
-          "/Filter /ASCII85Decode\n/Length %.20g 0 R\n/Alternate /%s\n>>\n"
+        (void) FormatLocaleString(buffer,MagickPathExtent,"<<\n/N %.17g\n"
+          "/Filter /ASCII85Decode\n/Length %.17g 0 R\n/Alternate /%s\n>>\n"
           "stream\n",(double) channels,(double) object+1,device);
         (void) WriteBlobString(image,buffer);
         offset=TellBlob(image);
@@ -2544,10 +2544,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           Write Length object.
         */
         xref[object++]=TellBlob(image);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",
           (double) object);
         (void) WriteBlobString(image,buffer);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
           offset);
         (void) WriteBlobString(image,buffer);
       }
@@ -2571,7 +2571,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         return(MagickFalse);
       }
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
@@ -2621,7 +2621,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           MagickPathExtent);
         (void) WriteBlobString(image,buffer);
         (void) FormatLocaleString(buffer,MagickPathExtent,"/DecodeParms [ "
-          "<< /K %s /BlackIs1 false /Columns %.20g /Rows %.20g >> ]\n",
+          "<< /K %s /BlackIs1 false /Columns %.17g /Rows %.17g >> ]\n",
           CCITTParam,(double) tile_image->columns,(double) tile_image->rows);
         break;
       }
@@ -2633,21 +2633,21 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       }
     }
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Width %.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Width %.17g\n",(double)
       tile_image->columns);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Height %.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Height %.17g\n",(double)
       tile_image->rows);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "/ColorSpace %.20g 0 R\n",(double) object-
+      "/ColorSpace %.17g 0 R\n",(double) object-
       (icc_profile != (StringInfo *) NULL ? 3 : 1));
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
       "/BitsPerComponent %d\n",(compression == FaxCompression) ||
       (compression == Group4Compression) ? 1 : 8);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g 0 R\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.17g 0 R\n",
       (double) object+1);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
@@ -2984,15 +2984,15 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
       offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
@@ -3006,7 +3006,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
         */
         if (compression == NoCompression)
           (void) WriteBlobString(image,"/Filter [ /ASCII85Decode ]\n");
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g 0 R\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.17g 0 R\n",
           (double) object+1);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,">>\n");
@@ -3043,10 +3043,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
       offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
@@ -3054,7 +3054,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write softmask object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
@@ -3064,7 +3064,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       {
         (void) WriteBlobString(image,"/Type /XObject\n");
         (void) WriteBlobString(image,"/Subtype /Image\n");
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/Name /Ma%.20g\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/Name /Ma%.17g\n",
           (double) image->scene);
         (void) WriteBlobString(image,buffer);
         switch (compression)
@@ -3095,10 +3095,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           }
         }
         (void) WriteBlobString(image,buffer);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/Width %.20g\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/Width %.17g\n",
           (double) image->columns);
         (void) WriteBlobString(image,buffer);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/Height %.20g\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/Height %.17g\n",
           (double) image->rows);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"/ColorSpace /DeviceGray\n");
@@ -3106,7 +3106,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
           "/BitsPerComponent %d\n",(compression == FaxCompression) ||
           (compression == Group4Compression) ? 1 : 8);
         (void) WriteBlobString(image,buffer);
-        (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g 0 R\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.17g 0 R\n",
           (double) object+1);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,">>\n");
@@ -3194,10 +3194,10 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
       offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
@@ -3213,7 +3213,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
   */
   xref[object++]=TellBlob(image);
   info_id=object;
-  (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g 0 obj\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g 0 obj\n",(double)
     object);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"<<\n");
@@ -3245,7 +3245,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
   */
   offset=TellBlob(image)-xref[0]+((is_pdfa != MagickFalse) ? 6 : 0)+9;
   (void) WriteBlobString(image,"xref\n");
-  (void) FormatLocaleString(buffer,MagickPathExtent,"0 %.20g\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"0 %.17g\n",(double)
     object+1);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"0000000000 65535 f \n");
@@ -3257,13 +3257,13 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
   }
   (void) WriteBlobString(image,"trailer\n");
   (void) WriteBlobString(image,"<<\n");
-  (void) FormatLocaleString(buffer,MagickPathExtent,"/Size %.20g\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"/Size %.17g\n",(double)
     object+1);
   (void) WriteBlobString(image,buffer);
-  (void) FormatLocaleString(buffer,MagickPathExtent,"/Info %.20g 0 R\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"/Info %.17g 0 R\n",(double)
     info_id);
   (void) WriteBlobString(image,buffer);
-  (void) FormatLocaleString(buffer,MagickPathExtent,"/Root %.20g 0 R\n",(double)
+  (void) FormatLocaleString(buffer,MagickPathExtent,"/Root %.17g 0 R\n",(double)
     root_id);
   (void) WriteBlobString(image,buffer);
   option=GetImageOption(image_info,"pdf:no-identifier");
@@ -3277,7 +3277,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
     }
   (void) WriteBlobString(image,">>\n");
   (void) WriteBlobString(image,"startxref\n");
-  (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double) offset);
+  (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double) offset);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"%%EOF\n");
   xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
diff --git a/coders/png.c b/coders/png.c
index c875d2e28..40bee6f9a 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -1178,7 +1178,7 @@ static void LogPNGChunk(MagickBooleanType logging, const png_byte *type,
 {
   if (logging != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  Writing %c%c%c%c chunk, length: %.20g",
+      "  Writing %c%c%c%c chunk, length: %.17g",
       type[0],type[1],type[2],type[3],(double) length);
 }

@@ -1343,7 +1343,7 @@ static void png_get_data(png_structp png_ptr,png_bytep data,png_size_t length)
           if (check < length)
             (void) memset(data+check,0,length-check);
           (void) FormatLocaleString(msg,MagickPathExtent,
-            "Expected %.20g bytes; found %.20g bytes",(double) length,
+            "Expected %.17g bytes; found %.17g bytes",(double) length,
             (double) check);
           png_warning(png_ptr,msg);
           MagickPNGError(png_ptr,CorruptImageError,"UnexpectedEndOfFile");
@@ -2458,7 +2458,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,
   if (logging != MagickFalse)
     {
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    PNG width: %.20g, height: %.20g\n"
+        "    PNG width: %.17g, height: %.17g\n"
         "    PNG color_type: %d, bit_depth: %d\n"
         "    PNG compression_method: %d\n"
         "    PNG interlace_method: %d, filter_method: %d",
@@ -2702,7 +2702,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,
         if (image->page.x || image->page.y)
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "    Reading PNG oFFs chunk: x: %.20g, y: %.20g.",(double)
+              "    Reading PNG oFFs chunk: x: %.17g, y: %.17g.",(double)
               image->page.x,(double) image->page.y);
     }
 #endif
@@ -2740,7 +2740,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,

       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    Reading PNG pHYs chunk: xres: %.20g, yres: %.20g, units: %d.",
+          "    Reading PNG pHYs chunk: xres: %.17g, yres: %.17g, units: %d.",
           (double) x_resolution,(double) y_resolution,unit_type);
     }
 #endif
@@ -2858,7 +2858,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,

         if (logging != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "    image->background_color=(%.20g,%.20g,%.20g).",
+            "    image->background_color=(%.17g,%.17g,%.17g).",
             (double) image->background_color.red,
             (double) image->background_color.green,
             (double) image->background_color.blue);
@@ -3165,7 +3165,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,

       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    Skipping PNG image data for scene %.20g",(double)
+          "    Skipping PNG image data for scene %.17g",(double)
           mng_info->scenes_found-1);
       png_destroy_read_struct(&ping,&ping_info,&end_info);

@@ -3860,7 +3860,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,
      if (png_get_valid(ping,ping_info,PNG_INFO_oFFs))
        {
          (void) FormatLocaleString(msg,MagickPathExtent,
-            "x_off=%.20g, y_off=%.20g",
+            "x_off=%.17g, y_off=%.17g",
             (double) image->page.x,(double) image->page.y);
          (void) SetImageProperty(image,"png:oFFs",msg,exception);
        }
@@ -3879,7 +3879,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info,
          (image->page.x != 0 || image->page.y != 0))
        {
          (void) FormatLocaleString(msg,MagickPathExtent,
-            "width=%.20g, height=%.20g, x_offset=%.20g, y_offset=%.20g",
+            "width=%.17g, height=%.17g, x_offset=%.17g, y_offset=%.17g",
             (double) image->page.width,(double) image->page.height,
             (double) image->page.x,(double) image->page.y);
          (void) SetImageProperty(image,"png:caNv",msg,exception);
@@ -4018,7 +4018,7 @@ static Image *ReadPNGImage(const ImageInfo *image_info,
   if (logging != MagickFalse)
     {
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-           "  page.w: %.20g, page.h: %.20g,page.x: %.20g, page.y: %.20g.",
+           "  page.w: %.17g, page.h: %.17g,page.x: %.17g, page.y: %.17g.",
                (double) image->page.width,(double) image->page.height,
                (double) image->page.x,(double) image->page.y);
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -4216,7 +4216,7 @@ static Image *ReadOneJNGImage(MngReadInfo *mng_info,

     if (logging != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  Reading JNG chunk type %c%c%c%c, length: %.20g",
+        "  Reading JNG chunk type %c%c%c%c, length: %.17g",
         type[0],type[1],type[2],type[3],(double) length);

     if (length > PNG_UINT_31_MAX || count == 0)
@@ -5142,7 +5142,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

         if (logging != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-           "  Reading MNG chunk type %c%c%c%c, length: %.20g",
+           "  Reading MNG chunk type %c%c%c%c, length: %.17g",
            type[0],type[1],type[2],type[3],(double) length);

         if ((length > PNG_UINT_31_MAX) || (length > GetBlobSize(image)) ||
@@ -5221,9 +5221,9 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
             if (logging != MagickFalse)
               {
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "  MNG width: %.20g",(double) mng_info->mng_width);
+                  "  MNG width: %.17g",(double) mng_info->mng_width);
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "  MNG height: %.20g",(double) mng_info->mng_height);
+                  "  MNG height: %.17g",(double) mng_info->mng_height);
               }

             p+=(ptrdiff_t) 8;
@@ -5272,7 +5272,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
               }

             (void) FormatLocaleString(page_geometry,MagickPathExtent,
-              "%.20gx%.20g+0+0",(double) mng_info->mng_width,(double)
+              "%.17gx%.17g+0+0",(double) mng_info->mng_width,(double)
               mng_info->mng_height);

             mng_info->frame.left=0;
@@ -5311,7 +5311,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
             if (logging != MagickFalse)
               {
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "    repeat=%d,  final_delay=%.20g,  iterations=%.20g",
+                  "    repeat=%d,  final_delay=%.17g,  iterations=%.17g",
                   repeat,(double) final_delay, (double) image->iterations);
               }

@@ -5379,7 +5379,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
                 if (logging != MagickFalse)
                   {
                     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                      "  x_off[%d]: %.20g,  y_off[%d]: %.20g",
+                      "  x_off[%d]: %.17g,  y_off[%d]: %.17g",
                       object_id,(double) mng_info->x_off[object_id],
                       object_id,(double) mng_info->y_off[object_id]);
                   }
@@ -5622,7 +5622,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "    Framing_delay=%.20g",(double) frame_delay);
+                            "    Framing_delay=%.17g",(double) frame_delay);
                       }

                     if (change_timeout && ((p-chunk)+4 <= (ssize_t) length))
@@ -5643,7 +5643,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "    Framing_timeout=%.20g",(double) frame_timeout);
+                            "    Framing_timeout=%.17g",(double) frame_timeout);
                       }

                     if (change_clipping && ((p-chunk) < (ssize_t) (length-16)))
@@ -5654,7 +5654,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "    Frame_clip: L=%.20g R=%.20g T=%.20g B=%.20g",
+                            "    Frame_clip: L=%.17g R=%.17g T=%.17g B=%.17g",
                             (double) fb.left,(double) fb.right,(double) fb.top,
                             (double) fb.bottom);

@@ -5676,7 +5676,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
             */
             if (logging != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "   subframe_width=%.20g, subframe_height=%.20g",(double)
+                "   subframe_width=%.17g, subframe_height=%.17g",(double)
                 subframe_width,(double) subframe_height);

             if (insert_layers && (mng_info->framing_mode == 4) &&
@@ -5721,7 +5721,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
                   }
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "  Insert backgd layer, L=%.20g, R=%.20g T=%.20g, B=%.20g",
+                    "  Insert backgd layer, L=%.17g, R=%.17g T=%.17g, B=%.17g",
                     (double) mng_info->clip.left,
                     (double) mng_info->clip.right,
                     (double) mng_info->clip.top,
@@ -5866,7 +5866,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "  LOOP level %.20g has %.20g iterations ",
+                    "  LOOP level %.17g has %.17g iterations ",
                     (double) loop_level, (double) loop_iters);

                 if (loop_iters <= 0)
@@ -5922,7 +5922,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                          "  ENDL: LOOP level %.20g has %.20g remaining iters",
+                          "  ENDL: LOOP level %.17g has %.17g remaining iters",
                             (double) loop_level,(double)
                             mng_info->loop_count[loop_level]);

@@ -6259,7 +6259,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
                 (void) SetImageBackgroundColor(image,exception);
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "  Inserted transparent background layer, W=%.20g, H=%.20g",
+                    "  Inserted transparent background layer, W=%.17g, H=%.17g",
                     (double) mng_info->mng_width,(double) mng_info->mng_height);
               }
           }
@@ -6309,7 +6309,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

             if (logging != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  Insert background layer, L=%.20g, R=%.20g T=%.20g, B=%.20g",
+                "  Insert background layer, L=%.17g, R=%.17g T=%.17g, B=%.17g",
                 (double) mng_info->clip.left,(double) mng_info->clip.right,
                 (double) mng_info->clip.top,(double) mng_info->clip.bottom);
           }
@@ -6597,7 +6597,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "    Magnify the rows to %.20g",
+                    "    Magnify the rows to %.17g",
                     (double) large_image->rows);
                 m=(ssize_t) mng_info->magn_mt;
                 yy=0;
@@ -6801,7 +6801,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
                 /* magnify the columns */
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "    Magnify the columns to %.20g",
+                    "    Magnify the columns to %.17g",
                     (double) image->columns);

                 for (y=0; y < (ssize_t) image->rows; y++)
@@ -7214,7 +7214,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,

   if (logging != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  image->delay=%.20g, final_delay=%.20g",(double) image->delay,
+        "  image->delay=%.17g, final_delay=%.17g",(double) image->delay,
         (double) final_delay);

   if (logging != MagickFalse)
@@ -7229,13 +7229,13 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
         "  Before coalesce:");

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    scene 0 delay=%.20g",(double) image->delay);
+        "    scene 0 delay=%.17g",(double) image->delay);

       while (GetNextImageInList(image) != (Image *) NULL)
       {
         image=GetNextImageInList(image);
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    scene %.20g delay=%.20g",(double) scene++,
+          "    scene %.17g delay=%.17g",(double) scene++,
           (double) image->delay);
       }
     }
@@ -7303,7 +7303,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
         "  After coalesce:");

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    scene 0 delay=%.20g dispose=%.20g",(double) image->delay,
+        "    scene 0 delay=%.17g dispose=%.17g",(double) image->delay,
         (double) image->dispose);

       while (GetNextImageInList(image) != (Image *) NULL)
@@ -7311,7 +7311,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
         image=GetNextImageInList(image);

         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    scene %.20g delay=%.20g dispose=%.20g",(double) scene++,
+          "    scene %.17g delay=%.17g dispose=%.17g",(double) scene++,
           (double) image->delay,(double) image->dispose);
       }
    }
@@ -7731,7 +7731,7 @@ static void Magick_png_write_raw_profile(const ImageInfo *image_info,
      }
    if (image_info->verbose != MagickFalse)
      {
-       (void) printf("writing raw profile: type=%s, length=%.20g\n",
+       (void) printf("writing raw profile: type=%s, length=%.17g\n",
          (char *) profile_type, (double) length);
      }
    description_length=(png_uint_32) strlen((const char *) profile_description);
@@ -8542,13 +8542,13 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
    if (logging != MagickFalse)
      {
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-             "      image->columns=%.20g",(double) image->columns);
+             "      image->columns=%.17g",(double) image->columns);
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-             "      image->rows=%.20g",(double) image->rows);
+             "      image->rows=%.17g",(double) image->rows);
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-             "      image->alpha_trait=%.20g",(double) image->alpha_trait);
+             "      image->alpha_trait=%.17g",(double) image->alpha_trait);
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-             "      image->depth=%.20g",(double) image->depth);
+             "      image->depth=%.17g",(double) image->depth);

        if (image->storage_class == PseudoClass && image->colormap != NULL)
        {
@@ -9533,15 +9533,15 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
   if (logging != MagickFalse)
     {
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    width=%.20g",(double) ping_width);
+        "    width=%.17g",(double) ping_width);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    height=%.20g",(double) ping_height);
+        "    height=%.17g",(double) ping_height);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_matte=%.20g",(double) image->alpha_trait);
+        "    image_matte=%.17g",(double) image->alpha_trait);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image->depth=%.20g",(double) image->depth);
+        "    image->depth=%.17g",(double) image->depth);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Tentative ping_bit_depth=%.20g",(double) image_depth);
+        "    Tentative ping_bit_depth=%.17g",(double) image_depth);
     }

   save_image_depth=image_depth;
@@ -9587,7 +9587,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,

       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    Set up PNG pHYs chunk: xres: %.20g, yres: %.20g, units: %d.",
+          "    Set up PNG pHYs chunk: xres: %.17g, yres: %.17g, units: %d.",
           (double) ping_pHYs_x_resolution,(double) ping_pHYs_y_resolution,
           (int) ping_pHYs_unit_type);
        ping_have_pHYs = MagickTrue;
@@ -9866,7 +9866,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
       if (logging != MagickFalse)
          {
            (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "    Number of colors: %.20g",(double) image_colors);
+            "    Number of colors: %.17g",(double) image_colors);

            (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "    Tentative PNG bit depth: %d",ping_bit_depth);
@@ -9881,22 +9881,22 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
   if (logging != MagickFalse)
     {
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Tentative PNG color type: %s (%.20g)",
+        "    Tentative PNG color type: %s (%.17g)",
         PngColorTypeToString((unsigned int) ping_color_type),
         (double) ping_color_type);

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_info->type: %.20g",(double) image_info->type);
+        "    image_info->type: %.17g",(double) image_info->type);

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_depth: %.20g",(double) image_depth);
+        "    image_depth: %.17g",(double) image_depth);

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),

-        "    image->depth: %.20g",(double) image->depth);
+        "    image->depth: %.17g",(double) image->depth);

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    ping_bit_depth: %.20g",(double) ping_bit_depth);
+        "    ping_bit_depth: %.17g",(double) ping_bit_depth);
     }

   if (matte != MagickFalse)
@@ -10300,7 +10300,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,

   if (logging != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "    PNG color type: %s (%.20g)", PngColorTypeToString((unsigned int)
+      "    PNG color type: %s (%.17g)", PngColorTypeToString((unsigned int)
       ping_color_type), (double) ping_color_type);
   /*
     Initialize compression level and filtering.
@@ -10684,7 +10684,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
           */
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Setting up gAMA chunk (%.20g)",image->gamma);
+              "  Setting up gAMA chunk (%.17g)",image->gamma);

           png_set_gAMA(ping,ping_info,image->gamma);
         }
@@ -11024,7 +11024,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
         "  Writing PNG image data");

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Allocating %.20g bytes of memory for pixels",(double) rowbytes);
+        "    Allocating %.17g bytes of memory for pixels",(double) rowbytes);
     }
   pixel_info=AcquireVirtualMemory(rowbytes,GetPixelChannels(image)*
     sizeof(*ping_pixels));
@@ -11326,10 +11326,10 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
         "  Wrote PNG image data");

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Width: %.20g",(double) ping_width);
+        "    Width: %.17g",(double) ping_width);

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Height: %.20g",(double) ping_height);
+        "    Height: %.17g",(double) ping_height);

       if (mng_info->depth)
         {
@@ -12434,7 +12434,7 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info,

           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Successfully read jpeg_image into a blob, length=%.20g.",
+              "  Successfully read jpeg_image into a blob, length=%.17g.",
               (double) length);

         }
@@ -12669,7 +12669,7 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info,
           /* Write IDAT chunk header */
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Write IDAT chunks from blob, length=%.20g.",(double)
+              "  Write IDAT chunks from blob, length=%.17g.",(double)
               length);

           /* Copy IDAT chunks */
@@ -12696,7 +12696,7 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info,
               {
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "    Skipping %c%c%c%c chunk, length=%.20g.",
+                    "    Skipping %c%c%c%c chunk, length=%.17g.",
                     *(p),*(p+1),*(p+2),*(p+3),(double) len);
               }
             p+=(ptrdiff_t) (8+len);
@@ -12707,7 +12707,7 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info,
           /* Write JDAA chunk header */
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Write JDAA chunk, length=%.20g.",(double) length);
+              "  Write JDAA chunk, length=%.17g.",(double) length);
           (void) WriteBlobMSBULong(image,(size_t) length);
           PNGType(chunk,mng_JDAA);
           LogPNGChunk(logging,mng_JDAA,length);
@@ -12749,7 +12749,7 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info,

   if (logging != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  Created jpeg_image, %.20g x %.20g.",(double) jpeg_image->columns,
+      "  Created jpeg_image, %.17g x %.17g.",(double) jpeg_image->columns,
       (double) jpeg_image->rows);

   if (status == MagickFalse)
@@ -12784,11 +12784,11 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info,
   if (logging != MagickFalse)
     {
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  Successfully read jpeg_image into a blob, length=%.20g.",
+        "  Successfully read jpeg_image into a blob, length=%.17g.",
         (double) length);

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  Write JDAT chunk, length=%.20g.",(double) length);
+        "  Write JDAT chunk, length=%.17g.",(double) length);
     }

   /* Write JDAT chunk(s) */
@@ -12990,7 +12990,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,

       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "  Checking input image(s)\n"
-        "    Image_info depth: %.20g,    Type: %d",
+        "    Image_info depth: %.17g,    Type: %d",
         (double) image_info->depth, image_info->type);

       scene=0;
@@ -12998,7 +12998,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,
       {

         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-           "    Scene: %.20g\n,   Image depth: %.20g",
+           "    Scene: %.17g\n,   Image depth: %.17g",
            (double) scene, (double) p->depth);
         scene+=1;

@@ -13020,7 +13020,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,

         if (p->colors)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "      Number of colors: %.20g",(double) p->colors);
+            "      Number of colors: %.17g",(double) p->colors);

         else
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -13333,16 +13333,16 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,
          if (logging != MagickFalse)
            {
              (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-               "     TERM delay: %.20g",(double) (mng_info->ticks_per_second*
+               "     TERM delay: %.17g",(double) (mng_info->ticks_per_second*
               final_delay/(size_t) MagickMax(image->ticks_per_second,1)));

              if (image->iterations == 0)
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                 "     TERM iterations: %.20g",(double) PNG_UINT_31_MAX);
+                 "     TERM iterations: %.17g",(double) PNG_UINT_31_MAX);

              else
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                 "     Image iterations: %.20g",(double) image->iterations);
+                 "     Image iterations: %.17g",(double) image->iterations);
            }
          (void) WriteBlob(image,14,chunk);
          (void) WriteBlobMSBULong(image,crc32(0,chunk,14));
diff --git a/coders/pnm.c b/coders/pnm.c
index 32f0d2938..839dd56c5 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -1961,7 +1961,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
       }
     if (format != '7')
       {
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g %.17g\n",
           (double) image->columns,(double) image->rows);
         (void) WriteBlobString(image,buffer);
       }
@@ -1974,7 +1974,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
           PAM header.
         */
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "WIDTH %.20g\nHEIGHT %.20g\n",(double) image->columns,(double)
+          "WIDTH %.17g\nHEIGHT %.17g\n",(double) image->columns,(double)
           image->rows);
         (void) WriteBlobString(image,buffer);
         quantum_type=GetQuantumType(image,exception);
@@ -2021,7 +2021,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
         if (image->depth > 32)
           image->depth=32;
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "DEPTH %.20g\nMAXVAL %.20g\n",(double) packet_size,(double)
+          "DEPTH %.17g\nMAXVAL %.17g\n",(double) packet_size,(double)
           ((MagickOffsetType) GetQuantumRange(image->depth)));
         (void) WriteBlobString(image,buffer);
         (void) FormatLocaleString(buffer,MagickPathExtent,
@@ -2310,7 +2310,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
         */
         if (image->depth > 32)
           image->depth=32;
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
           ((MagickOffsetType) GetQuantumRange(image->depth)));
         (void) WriteBlobString(image,buffer);
         quantum_info=AcquireQuantumInfo(image_info,image);
@@ -2430,7 +2430,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
           (void) TransformImageColorspace(image,sRGBColorspace,exception);
         if (image->depth > 32)
           image->depth=32;
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
           ((MagickOffsetType) GetQuantumRange(image->depth)));
         (void) WriteBlobString(image,buffer);
         quantum_info=AcquireQuantumInfo(image_info,image);
diff --git a/coders/ps.c b/coders/ps.c
index 57bb7454f..0a0cc5e46 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -410,7 +410,7 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image,PSInfo *ps_info,
           Note spot names.
         */
         (void) FormatLocaleString(property,MagickPathExtent,
-          "pdf:SpotColor-%.20g",(double) spotcolor++);
+          "pdf:SpotColor-%.17g",(double) spotcolor++);
         i=0;
         for (c=PeekMagickByteBuffer(&buffer); c != EOF; c=PeekMagickByteBuffer(&buffer))
         {
@@ -784,7 +784,7 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
       if (image_info->ping != MagickFalse)
         (void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0");
       else
-        (void) FormatLocaleString(options,MagickPathExtent,"-g%.20gx%.20g ",
+        (void) FormatLocaleString(options,MagickPathExtent,"-g%.17gx%.17g ",
           (double) page.width,(double) page.height);
     }
   read_info=CloneImageInfo(image_info);
@@ -794,8 +794,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
       char
         pages[MagickPathExtent];

-      (void) FormatLocaleString(pages,MagickPathExtent,"-dFirstPage=%.20g "
-        "-dLastPage=%.20g ",(double) read_info->scene+1,(double)
+      (void) FormatLocaleString(pages,MagickPathExtent,"-dFirstPage=%.17g "
+        "-dLastPage=%.17g ",(double) read_info->scene+1,(double)
         (read_info->scene+read_info->number_scenes));
       (void) ConcatenateMagickString(options,pages,MagickPathExtent);
       read_info->number_scenes=0;
@@ -1592,14 +1592,14 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
         resolution.y=(double) ((size_t) (100.0*2.54*resolution.y+0.5)/100.0);
       }
     SetGeometry(image,&geometry);
-    (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.20gx%.20g",
+    (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.17gx%.17g",
       (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MagickPathExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
         (void) FormatLocaleString(page_geometry,MagickPathExtent,
-          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+          "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,(double)
           image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
@@ -1663,7 +1663,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
         else
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+              "%%%%BoundingBox: %.17g %.17g %.17g %.17g\n",ceil(bounds.x1-0.5),
               ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
             (void) WriteBlobString(image,buffer);
             (void) FormatLocaleString(buffer,MagickPathExtent,
@@ -1678,7 +1678,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
               Embed Photoshop profile.
             */
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%%BeginPhotoshop: %.20g",(double) GetStringInfoLength(profile));
+              "%%BeginPhotoshop: %.17g",(double) GetStringInfoLength(profile));
             (void) WriteBlobString(image,buffer);
             for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
             {
@@ -1707,7 +1707,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
             (void) WriteBlobString(image,"%%Orientation: Portrait\n");
             (void) WriteBlobString(image,"%%PageOrder: Ascend\n");
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%%%%Pages: %.20g\n",image_info->adjoin != MagickFalse ?
+              "%%%%Pages: %.17g\n",image_info->adjoin != MagickFalse ?
               (double) number_scenes : 1.0);
             (void) WriteBlobString(image,buffer);
           }
@@ -1731,7 +1731,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
               Dump image as bitmap.
             */
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%%%%BeginPreview: %.20g %.20g %.20g %.20g\n%%  ",(double)
+              "%%%%BeginPreview: %.17g %.17g %.17g %.17g\n%%  ",(double)
               preview_image->columns,(double) preview_image->rows,1.0,
               (double) ((((preview_image->columns+7) >> 3)*preview_image->rows+
               35)/36));
@@ -1817,11 +1817,11 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
         (void) WriteBlobString(image,"} bind def\n");
         (void) WriteBlobString(image,"%%EndProlog\n");
       }
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Page:  1 %.20g\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Page:  1 %.17g\n",
       (double) (page++));
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "%%%%PageBoundingBox: %.20g %.20g %.20g %.20g\n",(double) geometry.x,
+      "%%%%PageBoundingBox: %.17g %.17g %.17g %.17g\n",(double) geometry.x,
       (double) geometry.y,geometry.x+(double) geometry.width,geometry.y+(double)
       (geometry.height+text_size));
     (void) WriteBlobString(image,buffer);
@@ -1843,7 +1843,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
       Output image data.
     */
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "%.20g %.20g\n%g %g\n%g\n",(double) geometry.x,(double) geometry.y,
+      "%.17g %.17g\n%g %g\n%g\n",(double) geometry.x,(double) geometry.y,
       scale.x,scale.y,pointsize);
     (void) WriteBlobString(image,buffer);
     labels=(char **) NULL;
@@ -1875,7 +1875,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
               Dump image as grayscale.
             */
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%.20g %.20g\n1\n1\n1\n8\n",(double) image->columns,(double)
+              "%.17g %.17g\n1\n1\n1\n8\n",(double) image->columns,(double)
               image->rows);
             (void) WriteBlobString(image,buffer);
             q=pixels;
@@ -1920,7 +1920,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
               Dump image as bitmap.
             */
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%.20g %.20g\n1\n1\n1\n1\n",(double) image->columns,(double)
+              "%.17g %.17g\n1\n1\n1\n1\n",(double) image->columns,(double)
               image->rows);
             (void) WriteBlobString(image,buffer);
             q=pixels;
@@ -1989,7 +1989,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
             Dump DirectClass image.
           */
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "%.20g %.20g\n0\n%d\n",(double) image->columns,(double) image->rows,
+            "%.17g %.17g\n0\n%d\n",(double) image->columns,(double) image->rows,
             compression == RLECompression ? 1 : 0);
           (void) WriteBlobString(image,buffer);
           switch (compression)
@@ -2116,14 +2116,14 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
             Dump PseudoClass image.
           */
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "%.20g %.20g\n%d\n%d\n0\n",(double) image->columns,(double)
+            "%.17g %.17g\n%d\n%d\n0\n",(double) image->columns,(double)
             image->rows,image->storage_class == PseudoClass ? 1 : 0,
             compression == RLECompression ? 1 : 0);
           (void) WriteBlobString(image,buffer);
           /*
             Dump number of colors and colormap.
           */
-          (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+          (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
             image->colors);
           (void) WriteBlobString(image,buffer);
           for (i=0; i < (ssize_t) image->colors; i++)
@@ -2256,7 +2256,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
   if (page > 2)
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+        "%%%%BoundingBox: %.17g %.17g %.17g %.17g\n",ceil(bounds.x1-0.5),
         ceil(bounds.y1-0.5),floor(bounds.x2-0.5),floor(bounds.y2-0.5));
       (void) WriteBlobString(image,buffer);
       (void) FormatLocaleString(buffer,MagickPathExtent,
diff --git a/coders/ps2.c b/coders/ps2.c
index 009129a98..984fd528d 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -585,14 +585,14 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
         resolution.y=(double) (100.0*2.54*resolution.y+0.5)/100.0;
       }
     SetGeometry(image,&geometry);
-    (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.20gx%.20g",
+    (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.17gx%.17g",
       (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MagickPathExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
         (void) FormatLocaleString(page_geometry,MagickPathExtent,
-          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+          "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,(double)
           image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
@@ -656,7 +656,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
         else
           {
             (void) FormatLocaleString(buffer,MagickPathExtent,
-              "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+              "%%%%BoundingBox: %.17g %.17g %.17g %.17g\n",ceil(bounds.x1-0.5),
               ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
             (void) WriteBlobString(image,buffer);
             (void) FormatLocaleString(buffer,MagickPathExtent,
@@ -679,7 +679,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
               (void) CopyMagickString(buffer,"%%Pages: 1\n",MagickPathExtent);
             else
               (void) FormatLocaleString(buffer,MagickPathExtent,
-                "%%%%Pages: %.20g\n",(double) number_scenes);
+                "%%%%Pages: %.17g\n",(double) number_scenes);
             (void) WriteBlobString(image,buffer);
           }
         if (image->colorspace == CMYKColorspace)
@@ -745,11 +745,11 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
         (void) WriteBlobString(image,"} bind def\n");
         (void) WriteBlobString(image,"%%EndProlog\n");
       }
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Page:  1 %.20g\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Page:  1 %.17g\n",
       (double) page++);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "%%%%PageBoundingBox: %.20g %.20g %.20g %.20g\n",(double) geometry.x,
+      "%%%%PageBoundingBox: %.17g %.17g %.17g %.17g\n",(double) geometry.x,
       (double) geometry.y,geometry.x+(double) geometry.width,geometry.y+(double)
       (geometry.height+text_size));
     (void) WriteBlobString(image,buffer);
@@ -778,7 +778,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
       Output image data.
     */
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "%.20g %.20g\n%g %g\n%g\n",(double) geometry.x,(double) geometry.y,
+      "%.17g %.17g\n%g %g\n%g\n",(double) geometry.x,(double) geometry.y,
       scale.x,scale.y,pointsize);
     (void) WriteBlobString(image,buffer);
     labels=(char **) NULL;
@@ -804,7 +804,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
          (IdentifyImageCoderGray(image,exception) != MagickFalse)))
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "%.20g %.20g\n1\n%d\n",(double) image->columns,(double) image->rows,
+          "%.17g %.17g\n1\n%d\n",(double) image->columns,(double) image->rows,
           (int) (image->colorspace == CMYKColorspace));
         (void) WriteBlobString(image,buffer);
         (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n",(int)
@@ -920,7 +920,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
           (compression == JPEGCompression) || (image->alpha_trait != UndefinedPixelTrait))
         {
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "%.20g %.20g\n0\n%d\n",(double) image->columns,(double) image->rows,
+            "%.17g %.17g\n0\n%d\n",(double) image->columns,(double) image->rows,
             (int) (image->colorspace == CMYKColorspace));
           (void) WriteBlobString(image,buffer);
           (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n",
@@ -1070,13 +1070,13 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
             Dump number of colors and colormap.
           */
           (void) FormatLocaleString(buffer,MagickPathExtent,
-            "%.20g %.20g\n1\n%d\n",(double) image->columns,(double) image->rows,
+            "%.17g %.17g\n1\n%d\n",(double) image->columns,(double) image->rows,
             (int) (image->colorspace == CMYKColorspace));
           (void) WriteBlobString(image,buffer);
           (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n",
             (int) (compression == NoCompression));
           (void) WriteBlobString(image,buffer);
-          (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",(double)
+          (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",(double)
             image->colors);
           (void) WriteBlobString(image,buffer);
           for (i=0; i < (ssize_t) image->colors; i++)
@@ -1191,7 +1191,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
   if (page > 1)
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+        "%%%%BoundingBox: %.17g %.17g %.17g %.17g\n",ceil(bounds.x1-0.5),
         ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
       (void) WriteBlobString(image,buffer);
       (void) FormatLocaleString(buffer,MagickPathExtent,
diff --git a/coders/ps3.c b/coders/ps3.c
index 74b75512d..ad1aa0173 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -573,7 +573,7 @@ static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
     default:
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "currentfile %.20g %.20g " PS3_NoCompression
+        "currentfile %.17g %.17g " PS3_NoCompression
         " ByteStreamDecodeFilter\n",(double) image->columns,(double)
         image->rows);
       break;
@@ -582,7 +582,7 @@ static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
     case Group4Compression:
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "currentfile %.20g %.20g " PS3_FaxCompression
+        "currentfile %.17g %.17g " PS3_FaxCompression
         " ByteStreamDecodeFilter\n",(double) image->columns,(double)
         image->rows);
       break;
@@ -590,7 +590,7 @@ static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
     case LZWCompression:
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "currentfile %.20g %.20g " PS3_LZWCompression
+        "currentfile %.17g %.17g " PS3_LZWCompression
         " ByteStreamDecodeFilter\n",(double) image->columns,(double)
         image->rows);
       break;
@@ -598,7 +598,7 @@ static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
     case RLECompression:
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "currentfile %.20g %.20g " PS3_RLECompression
+        "currentfile %.17g %.17g " PS3_RLECompression
         " ByteStreamDecodeFilter\n",(double) image->columns,(double)
         image->rows);
       break;
@@ -606,7 +606,7 @@ static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
     case ZipCompression:
     {
       (void) FormatLocaleString(buffer,MagickPathExtent,
-        "currentfile %.20g %.20g " PS3_ZipCompression
+        "currentfile %.17g %.17g " PS3_ZipCompression
         " ByteStreamDecodeFilter\n",(double) image->columns,(double)
         image->rows);
       break;
@@ -1048,14 +1048,14 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
         resolution.y=(100.0*2.54*resolution.y+0.5)/100.0;
       }
     SetGeometry(image,&geometry);
-    (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.20gx%.20g",
+    (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.17gx%.17g",
       (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MagickPathExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
         (void) FormatLocaleString(page_geometry,MagickPathExtent,
-          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+          "%.17gx%.17g%+.20g%+.20g",(double) image->page.width,(double)
           image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
@@ -1161,7 +1161,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
               (void) CopyMagickString(buffer,"%%Pages: 1\n",MagickPathExtent);
             else
               (void) FormatLocaleString(buffer,MagickPathExtent,
-                "%%%%Pages: %.20g\n",(double) number_scenes);
+                "%%%%Pages: %.17g\n",(double) number_scenes);
             (void) WriteBlobString(image,buffer);
           }
         if (image->colorspace == CMYKColorspace)
@@ -1196,14 +1196,14 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
         (void) WriteBlob(image,sizeof(PostscriptEpilog)-1,PostscriptEpilog);
         (void) WriteBlobString(image,"%%EndProlog\n");
       }
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Page: 1 %.20g\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Page: 1 %.17g\n",
       (double) page);
     (void) WriteBlobString(image,buffer);
     /*
       Page bounding box.
     */
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      "%%%%PageBoundingBox: %.20g %.20g %.20g %.20g\n",(double) geometry.x,
+      "%%%%PageBoundingBox: %.17g %.17g %.17g %.17g\n",(double) geometry.x,
        (double) geometry.y,geometry.x+(double) geometry.width,geometry.y+
        (double) (geometry.height+text_size));
     (void) WriteBlobString(image,buffer);
@@ -1278,7 +1278,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
     /*
       Translate, scale, and font point size.
     */
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n%g %g\n%g\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g %.17g\n%g %g\n%g\n",
       (double) geometry.x,(double) geometry.y,scale.x,scale.y,pointsize);
     (void) WriteBlobString(image,buffer);
     /*
@@ -1326,7 +1326,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
     /*
       Image columns, rows, and color space.
     */
-    (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n%s\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g %.17g\n%s\n",
       (double) image->columns,(double) image->rows,image->colorspace ==
       CMYKColorspace ? PS3_CMYKColorspace : PS3_RGBColorspace);
     (void) WriteBlobString(image,buffer);
@@ -1577,7 +1577,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
             /*
               Number of colors in color map.
             */
-            (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g\n",
+            (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g\n",
               (double) image->colors);
             (void) WriteBlobString(image,buffer);
             /*
diff --git a/coders/psd.c b/coders/psd.c
index 0a258fa4c..0205aed4c 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -398,7 +398,7 @@ static MagickBooleanType ApplyPSDLayerOpacity(Image *image,

   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  applying layer opacity %.20g", (double) opacity);
+      "  applying layer opacity %.17g", (double) opacity);
   if (opacity == OpaqueAlpha)
     return(MagickTrue);
   if (image->alpha_trait != BlendPixelTrait)
@@ -1506,7 +1506,7 @@ static MagickBooleanType ReadPSDChannel(Image *image,
       break;
     default:
       (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning,
-        "CompressionNotSupported","'%.20g'",(double) compression);
+        "CompressionNotSupported","'%.17g'",(double) compression);
       break;
   }

@@ -1616,16 +1616,16 @@ static MagickBooleanType ReadPSDLayer(Image *image,const ImageInfo *image_info,
   /*
     Set up some hidden attributes for folks that need them.
   */
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
     (double) layer_info->page.x);
   (void) SetImageArtifact(layer_info->image,"psd:layer.x",message);
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g",
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g",
     (double) layer_info->page.y);
   (void) SetImageArtifact(layer_info->image,"psd:layer.y",message);
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
     layer_info->opacity);
   (void) SetImageArtifact(layer_info->image,"psd:layer.opacity",message);
-  (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double)
+  (void) FormatLocaleString(message,MagickPathExtent,"%.17g",(double)
     layer_info->visible);
   (void) SetImageArtifact(layer_info->image,"psd:layer.visible",message);
   (void) SetImageProperty(layer_info->image,"label",(char *) layer_info->name,
@@ -1639,7 +1639,7 @@ static MagickBooleanType ReadPSDLayer(Image *image,const ImageInfo *image_info,
       {
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "    reading data for channel %.20g",(double) j);
+            "    reading data for channel %.17g",(double) j);

         compression=(PSDCompressionType) ReadBlobShort(layer_info->image);
         layer_info->image->compression=ConvertPSDCompression(compression);
@@ -1980,7 +1980,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,

   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  image contains %.20g layers",(double) number_layers);
+      "  image contains %.17g layers",(double) number_layers);

   if (number_layers == 0)
     ThrowBinaryException(CorruptImageError,"InvalidNumberOfLayers",
@@ -2008,7 +2008,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,

     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  reading layer #%.20g",(double) i+1);
+        "  reading layer #%.17g",(double) i+1);
     top=(ssize_t) ReadBlobSignedLong(image);
     left=(ssize_t) ReadBlobSignedLong(image);
     bottom=(ssize_t) ReadBlobSignedLong(image);
@@ -2032,7 +2032,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
       }
     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    offset(%.20g,%.20g), size(%.20g,%.20g), channels=%.20g",
+        "    offset(%.17g,%.17g), size(%.17g,%.17g), channels=%.17g",
         (double) layer_info[i].page.x,(double) layer_info[i].page.y,
         (double) layer_info[i].page.height,(double)
         layer_info[i].page.width,(double) layer_info[i].channels);
@@ -2045,7 +2045,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
         image);
       if (image->debug != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    channel[%.20g]: type=%.20g, size=%.20g",(double) j,
+          "    channel[%.17g]: type=%.17g, size=%.17g",(double) j,
           (double) layer_info[i].channel_info[j].channel,
           (double) layer_info[i].channel_info[j].size);
     }
@@ -2079,7 +2079,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
     layer_info[i].visible=!(layer_info[i].flags & 0x02);
     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "   blend=%.4s, opacity=%.20g, clipping=%s, flags=%d, visible=%s",
+        "   blend=%.4s, opacity=%.17g, clipping=%s, flags=%d, visible=%s",
         layer_info[i].blendkey,(double) layer_info[i].opacity,
         layer_info[i].clipping ? "true" : "false",layer_info[i].flags,
         layer_info[i].visible ? "true" : "false");
@@ -2120,7 +2120,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
               }
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "      layer mask: offset(%.20g,%.20g), size(%.20g,%.20g), length=%.20g",
+                "      layer mask: offset(%.17g,%.17g), size(%.17g,%.17g), length=%.17g",
                 (double) layer_info[i].mask.page.x,(double)
                 layer_info[i].mask.page.y,(double)
                 layer_info[i].mask.page.width,(double)
@@ -2145,7 +2145,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
             */
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "      layer blending ranges: length=%.20g",(double)
+                "      layer blending ranges: length=%.17g",(double)
                 ((MagickOffsetType) length));
             if (DiscardBlobBytes(image,length) == MagickFalse)
               {
@@ -2225,7 +2225,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
         layer_info=DestroyLayerInfo(layer_info,number_layers);
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  allocation of image for layer %.20g failed",(double) i);
+            "  allocation of image for layer %.17g failed",(double) i);
         ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
           image->filename);
       }
@@ -2271,7 +2271,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,

     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  reading data for layer %.20g",(double) i);
+        "  reading data for layer %.17g",(double) i);

     status=ReadPSDLayer(image,image_info,psd_info,&layer_info[i],
       exception);
@@ -2328,7 +2328,7 @@ static MagickBooleanType ReadPSDMergedImage(const ImageInfo *image_info,
   if (compression != Raw && compression != RLE)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        TypeWarning,"CompressionNotSupported","'%.20g'",(double) compression);
+        TypeWarning,"CompressionNotSupported","'%.17g'",(double) compression);
       return(MagickFalse);
     }

@@ -2359,7 +2359,7 @@ static MagickBooleanType ReadPSDMergedImage(const ImageInfo *image_info,
         if (status == MagickFalse)
           {
             (void) ThrowMagickException(exception,GetMagickModule(),
-              CorruptImageError,"MaximumChannelsExceeded","'%.20g'",(double) i);
+              CorruptImageError,"MaximumChannelsExceeded","'%.17g'",(double) i);
             break;
           }

@@ -2470,7 +2470,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  Image is %.20g x %.20g with channels=%.20g, depth=%.20g, mode=%s",
+      "  Image is %.17g x %.17g with channels=%.17g, depth=%.17g, mode=%s",
       (double) psd_info.columns,(double) psd_info.rows,(double)
       psd_info.channels,(double) psd_info.depth,ModeToString((PSDImageType)
       psd_info.mode));
@@ -2596,7 +2596,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
       */
       if (image->debug != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "  reading image resource blocks - %.20g bytes",(double)
+          "  reading image resource blocks - %.17g bytes",(double)
           ((MagickOffsetType) length));
       if (length > GetBlobSize(image))
         ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
@@ -3826,7 +3826,7 @@ static MagickBooleanType WritePSDLayersInternal(Image *image,
     property=(const char *) GetImageProperty(layer,"label",exception);
     if (property == (const char *) NULL)
       {
-        (void) FormatLocaleString(layer_name,MagickPathExtent,"L%.20g",
+        (void) FormatLocaleString(layer_name,MagickPathExtent,"L%.17g",
           (double) layer_index);
         property=layer_name;
       }
diff --git a/coders/svg.c b/coders/svg.c
index 1ff2cce7f..2cbd91ecd 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -312,14 +312,14 @@ static Image *RenderSVGImage(const ImageInfo *image_info,Image *image,
   (void) FormatLocaleString(output_filename,MagickPathExtent,"%s.png",unique);
   (void) RelinquishUniqueFileResource(unique);
   density=AcquireString("");
-  (void) FormatLocaleString(density,MagickPathExtent,"%.20g",
+  (void) FormatLocaleString(density,MagickPathExtent,"%.17g",
     sqrt(image->resolution.x*image->resolution.y));
   (void) FormatLocaleString(background,MagickPathExtent,
-    "rgb(%.20g%%,%.20g%%,%.20g%%)",
+    "rgb(%.17g%%,%.17g%%,%.17g%%)",
     100.0*QuantumScale*image->background_color.red,
     100.0*QuantumScale*image->background_color.green,
     100.0*QuantumScale*image->background_color.blue);
-  (void) FormatLocaleString(opacity,MagickPathExtent,"%.20g",QuantumScale*
+  (void) FormatLocaleString(opacity,MagickPathExtent,"%.17g",QuantumScale*
     image->background_color.alpha);
   (void) FormatLocaleString(command,MagickPathExtent,
     GetDelegateCommands(delegate_info),input_filename,output_filename,density,
@@ -2580,7 +2580,7 @@ static void SVGStartElement(void *context,const xmlChar *name,
           svg_info->height=0;
           if (svg_info->bounds.height >= MagickEpsilon)
             svg_info->height=CastDoubleToSizeT(svg_info->bounds.height+0.5);
-          (void) FormatLocaleFile(svg_info->file,"viewbox 0 0 %.20g %.20g\n",
+          (void) FormatLocaleFile(svg_info->file,"viewbox 0 0 %.17g %.17g\n",
             (double) svg_info->width,(double) svg_info->height);
           sx=MagickSafeReciprocal(svg_info->view_box.width)*svg_info->width;
           sy=MagickSafeReciprocal(svg_info->view_box.height)*svg_info->height;
@@ -2997,7 +2997,7 @@ static void SVGCharacters(void *context,const xmlChar *c,int length)
     Receiving some characters from the parser.
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-    "  SAX.characters(%s,%.20g)",c,(double) length);
+    "  SAX.characters(%s,%.17g)",c,(double) length);
   parser=(xmlParserCtxtPtr) context;
   svg_info=(SVGInfo *) parser->_private;
   text=(char *) AcquireQuantumMemory((size_t) length+1,sizeof(*text));
@@ -3735,8 +3735,8 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception)
       "<svg version=\"1.1\" id=\"Layer_1\" "
       "xmlns=\"http://www.w3.org/2000/svg\" "
       "xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" "
-      "width=\"%.20gpx\" height=\"%.20gpx\" viewBox=\"0 0 %.20g %.20g\" "
-      "enable-background=\"new 0 0 %.20g %.20g\" xml:space=\"preserve\">",
+      "width=\"%.17gpx\" height=\"%.17gpx\" viewBox=\"0 0 %.17g %.17g\" "
+      "enable-background=\"new 0 0 %.17g %.17g\" xml:space=\"preserve\">",
       (double) image->columns,(double) image->rows,
       (double) image->columns,(double) image->rows,
       (double) image->columns,(double) image->rows);
@@ -3757,8 +3757,8 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception)
     base64=Base64Encode(blob,blob_length,&encode_length);
     blob=(unsigned char *) RelinquishMagickMemory(blob);
     (void) FormatLocaleString(message,MagickPathExtent,
-      "  <image id=\"image%.20g\" width=\"%.20g\" height=\"%.20g\" "
-      "x=\"%.20g\" y=\"%.20g\"\n    xlink:href=\"data:image/png;base64,",
+      "  <image id=\"image%.17g\" width=\"%.17g\" height=\"%.17g\" "
+      "x=\"%.17g\" y=\"%.17g\"\n    xlink:href=\"data:image/png;base64,",
       (double) image->scene,(double) image->columns,(double) image->rows,
       (double) image->page.x,(double) image->page.y);
     (void) WriteBlobString(image,message);
@@ -3861,7 +3861,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
   (void) WriteBlobString(image,
     "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
   (void) FormatLocaleString(message,MagickPathExtent,
-    "<svg width=\"%.20g\" height=\"%.20g\" xmlns=\"http://www.w3.org/2000/svg\">\n",
+    "<svg width=\"%.17g\" height=\"%.17g\" xmlns=\"http://www.w3.org/2000/svg\">\n",
     (double) image->columns,(double) image->rows);
   (void) WriteBlobString(image,message);
   /*
diff --git a/coders/tiff.c b/coders/tiff.c
index cf9897e22..01d3cbe8f 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1436,7 +1436,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
     image->rows=(size_t) height;
     image->depth=(size_t) bits_per_sample;
     if (image->debug != MagickFalse)
-      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Image depth: %.20g",
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Image depth: %.17g",
         (double) image->depth);
     image->endian=MSBEndian;
     if (endian == FILLORDER_LSB2MSB)
diff --git a/coders/ttf.c b/coders/ttf.c
index 67c732201..49d003d01 100644
--- a/coders/ttf.c
+++ b/coders/ttf.c
@@ -257,10 +257,10 @@ static Image *ReadTTFImage(const ImageInfo *image_info,ExceptionInfo *exception)
   (void) ImageToFile(image,draw_info->font,exception);
   ConcatenateString(&draw_info->primitive,"push graphic-context\n");
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    " viewbox 0 0 %.20g %.20g\n",(double) image->columns,(double) image->rows);
+    " viewbox 0 0 %.17g %.17g\n",(double) image->columns,(double) image->rows);
   ConcatenateString(&draw_info->primitive,buffer);
   ConcatenateString(&draw_info->primitive," font-size 18\n");
-  (void) FormatLocaleString(buffer,MagickPathExtent," text 10,%.20g '",
+  (void) FormatLocaleString(buffer,MagickPathExtent," text 10,%.17g '",
     (double) y);
   ConcatenateString(&draw_info->primitive,buffer);
   text=EscapeString(Text,'"');
@@ -274,12 +274,12 @@ static Image *ReadTTFImage(const ImageInfo *image_info,ExceptionInfo *exception)
     y+=i+12;
     ConcatenateString(&draw_info->primitive," font-size 18\n");
     (void) FormatLocaleString(buffer,MagickPathExtent,
-      " text 10,%.20g '%.20g'\n",(double) y,(double) i);
+      " text 10,%.17g '%.17g'\n",(double) y,(double) i);
     ConcatenateString(&draw_info->primitive,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent," font-size %.20g\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent," font-size %.17g\n",
       (double) i);
     ConcatenateString(&draw_info->primitive,buffer);
-    (void) FormatLocaleString(buffer,MagickPathExtent," text 50,%.20g "
+    (void) FormatLocaleString(buffer,MagickPathExtent," text 50,%.17g "
       "'That which does not destroy me, only makes me stronger.'\n",(double) y);
     ConcatenateString(&draw_info->primitive,buffer);
     if (i >= 24)
diff --git a/coders/txt.c b/coders/txt.c
index da252cbe7..afb061b6b 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -723,7 +723,7 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
     if (LocaleCompare(image_info->magick,"SPARSE-COLOR") != 0)
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,
-          "# ImageMagick pixel enumeration: %.20g,%.20g,%.20g,%.20g,%s\n",
+          "# ImageMagick pixel enumeration: %.17g,%.17g,%.17g,%.17g,%s\n",
           (double) image->columns,(double) image->rows,
           (double) image->number_meta_channels,
           (double) GetQuantumRange(image->depth),colorspace);
@@ -758,7 +758,7 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
             if (GetPixelAlpha(image,p) == (Quantum) OpaqueAlpha)
               {
                 (void) FormatLocaleString(buffer,MagickPathExtent,
-                  "%.20g,%.20g,",(double) x,(double) y);
+                  "%.17g,%.17g,",(double) x,(double) y);
                 GetColorTuple(&pixel,MagickFalse,tuple);
                 (void) ConcatenateMagickString(buffer,tuple,MagickPathExtent);
                 (void) ConcatenateMagickString(buffer," ",MagickPathExtent);
@@ -767,12 +767,12 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
             p+=(ptrdiff_t) GetPixelChannels(image);
             continue;
           }
-        (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g,%.20g: (",
+        (void) FormatLocaleString(buffer,MagickPathExtent,"%.17g,%.17g: (",
           (double) x,(double) y);
         for (i=0; i < (ssize_t) GetImageChannels(image); i++)
         {
           QuantumAny channel = ScaleQuantumToAny(p[i],range);
-          (void) FormatLocaleString(tuple,MagickPathExtent,"%.20g",
+          (void) FormatLocaleString(tuple,MagickPathExtent,"%.17g",
             (double) channel);
           (void) ConcatenateMagickString(buffer,tuple,MagickPathExtent);
           if ((i+1) < (ssize_t) GetImageChannels(image))
diff --git a/coders/uhdr.c b/coders/uhdr.c
index db5d796fb..636eeacc5 100644
--- a/coders/uhdr.c
+++ b/coders/uhdr.c
@@ -151,7 +151,7 @@ static Image *ReadUHDRImage(const ImageInfo *image_info,
   (void) FormatLocaleString(buffer,sizeof(buffer),"%d",(value)); \
   (void) SetImageProperty(image,"hdrgm:" name,buffer,exception)
 #define SetHDRGMPropertySize(name,value) \
-  (void) FormatLocaleString(buffer,sizeof(buffer),"%.20g",(double) (value)); \
+  (void) FormatLocaleString(buffer,sizeof(buffer),"%.17g",(double) (value)); \
   (void) SetImageProperty(image,"hdrgm:" name,buffer,exception)
 #define SetHDRGMProperty3(name,value,value1,value2) \
   (void) FormatLocaleString(buffer,sizeof(buffer),"%f,%f,%f", \
@@ -641,7 +641,7 @@ static uhdr_mem_block_t GetExifProfile(Image *image, ExceptionInfo *exception)
       return uhdr_profile;
     }
     if (image->debug != MagickFalse)
-      (void)LogMagickEvent(CoderEvent, GetMagickModule(), "%s profile: %.20g bytes", name,
+      (void)LogMagickEvent(CoderEvent, GetMagickModule(), "%s profile: %.17g bytes", name,
                            (double)GetStringInfoLength(profile));
     name = GetNextImageProfile(image);
   }
diff --git a/coders/vicar.c b/coders/vicar.c
index 23c17fe84..528c77d68 100644
--- a/coders/vicar.c
+++ b/coders/vicar.c
@@ -575,8 +575,8 @@ static MagickBooleanType WriteVICARImage(const ImageInfo *image_info,
   */
   (void) memset(header,' ',MagickPathExtent);
   (void) FormatLocaleString(header,MagickPathExtent,
-    "LBLSIZE=%.20g FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
-    "RECSIZE=%.20g ORG='BSQ' NL=%.20g NS=%.20g NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
+    "LBLSIZE=%.17g FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
+    "RECSIZE=%.17g ORG='BSQ' NL=%.17g NS=%.17g NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
     "NLB=0 TASK='ImageMagick'",(double) MagickPathExtent,(double)
     image->columns,(double) image->rows,(double) image->columns);
   (void) WriteBlob(image,MagickPathExtent,(unsigned char *) header);
diff --git a/coders/vid.c b/coders/vid.c
index 6be5b7d2d..4b583b0c9 100644
--- a/coders/vid.c
+++ b/coders/vid.c
@@ -190,7 +190,7 @@ static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception)
       }
     if (IsEventLogging() != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "geometry: %.20gx%.20g",(double) next_image->columns,(double)
+        "geometry: %.17gx%.17g",(double) next_image->columns,(double)
         next_image->rows);
     SetGeometry(next_image,&geometry);
     (void) ParseMetaGeometry(read_info->size,&geometry.x,&geometry.y,
@@ -204,7 +204,7 @@ static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception)
       }
     if (IsEventLogging() != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "thumbnail geometry: %.20gx%.20g",(double) next_image->columns,(double)
+        "thumbnail geometry: %.17gx%.17g",(double) next_image->columns,(double)
         next_image->rows);
     AppendImageToList(&images,next_image);
     status=SetImageProgress(images,LoadImagesTag,i,(MagickSizeType)
diff --git a/coders/video.c b/coders/video.c
index 4aafb7ee7..89ae0b192 100644
--- a/coders/video.c
+++ b/coders/video.c
@@ -650,12 +650,12 @@ static MagickBooleanType WriteVIDEOImage(const ImageInfo *image_info,
           Image
             *frame;

-          (void) FormatLocaleString(p->filename,MagickPathExtent,"%s%.20g.%s",
+          (void) FormatLocaleString(p->filename,MagickPathExtent,"%s%.17g.%s",
             basename,(double) p->scene,intermediate_format);
-          (void) FormatLocaleString(filename,MagickPathExtent,"%s%.20g.%s",
+          (void) FormatLocaleString(filename,MagickPathExtent,"%s%.17g.%s",
             basename,(double) p->scene,intermediate_format);
           (void) FormatLocaleString(previous_image,MagickPathExtent,
-            "%s%.20g.%s",basename,(double) p->scene,intermediate_format);
+            "%s%.17g.%s",basename,(double) p->scene,intermediate_format);
           frame=CloneImage(p,0,0,MagickTrue,exception);
           if (frame == (Image *) NULL)
             break;
@@ -671,7 +671,7 @@ static MagickBooleanType WriteVIDEOImage(const ImageInfo *image_info,
         }
         default:
         {
-          (void) FormatLocaleString(filename,MagickPathExtent,"%s%.20g.%s",
+          (void) FormatLocaleString(filename,MagickPathExtent,"%s%.17g.%s",
             basename,(double) p->scene,intermediate_format);
           if (length > 0)
             status=BlobToFile(filename,blob,length,exception);
@@ -682,11 +682,11 @@ static MagickBooleanType WriteVIDEOImage(const ImageInfo *image_info,
         {
           if (status != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "%.20g. Wrote %s file for scene %.20g:",(double) i,
+              "%.17g. Wrote %s file for scene %.17g:",(double) i,
               intermediate_format,(double) p->scene);
           else
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "%.20g. Failed to write %s file for scene %.20g:",(double) i,
+              "%.17g. Failed to write %s file for scene %.17g:",(double) i,
               intermediate_format,(double) p->scene);
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),"%s",filename);
         }
@@ -736,7 +736,7 @@ static MagickBooleanType WriteVIDEOImage(const ImageInfo *image_info,
           if (time_per_frame > 0.0)
             {
               (void) FormatLocaleString(command,MagickPathExtent,
-                " -filter:v \"setpts=(25*%.20g)*PTS\" -r 1/%.20g",
+                " -filter:v \"setpts=(25*%.17g)*PTS\" -r 1/%.17g",
                 time_per_frame,time_per_frame);
               (void) ConcatenateMagickString(options,command,MagickPathExtent);
             }
@@ -776,7 +776,7 @@ static MagickBooleanType WriteVIDEOImage(const ImageInfo *image_info,
       length_of_delay_loop=(ssize_t) MagickMax((1.0*delay+1.0)/3.0,1.0);
     for (i=0; i < length_of_delay_loop; i++)
     {
-      (void) FormatLocaleString(p->filename,MagickPathExtent,"%s%.20g.%s",
+      (void) FormatLocaleString(p->filename,MagickPathExtent,"%s%.17g.%s",
         basename,(double) count++,intermediate_format);
       (void) RelinquishUniqueFileResource(p->filename);
     }
diff --git a/coders/wpg.c b/coders/wpg.c
index e1f813ebc..32b328eef 100644
--- a/coders/wpg.c
+++ b/coders/wpg.c
@@ -643,7 +643,7 @@ static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception)
           if(x!=0)
             {
               (void) FormatLocaleFile(stderr,
-                "\nUnsupported WPG2 unaligned token RST x=%.20g, please report!\n"
+                "\nUnsupported WPG2 unaligned token RST x=%.17g, please report!\n"
                 ,(double) x);
               BImgBuff=(unsigned char *) RelinquishMagickMemory(BImgBuff);
               return(-3);
diff --git a/coders/xbm.c b/coders/xbm.c
index d6cd5780d..108f7ad6f 100644
--- a/coders/xbm.c
+++ b/coders/xbm.c
@@ -555,10 +555,10 @@ static MagickBooleanType WriteXBMImage(const ImageInfo *image_info,Image *image,
     Write X bitmap header.
   */
   GetPathComponent(image->filename,BasePath,basename);
-  (void) FormatLocaleString(buffer,MagickPathExtent,"#define %s_width %.20g\n",
+  (void) FormatLocaleString(buffer,MagickPathExtent,"#define %s_width %.17g\n",
     basename,(double) image->columns);
   (void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
-  (void) FormatLocaleString(buffer,MagickPathExtent,"#define %s_height %.20g\n",
+  (void) FormatLocaleString(buffer,MagickPathExtent,"#define %s_height %.17g\n",
     basename,(double) image->rows);
   (void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
   (void) FormatLocaleString(buffer,MagickPathExtent,
diff --git a/coders/xpm.c b/coders/xpm.c
index 208cbd8e2..4437083fd 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -841,7 +841,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n");
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    "\"%.20g %.20g %.20g %.20g\",\n",(double) picon->columns,(double)
+    "\"%.17g %.17g %.17g %.17g\",\n",(double) picon->columns,(double)
     picon->rows,(double) colors,(double) characters_per_pixel);
   (void) WriteBlobString(image,buffer);
   GetPixelInfo(image,&pixel);
@@ -1077,7 +1077,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n");
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    "\"%.20g %.20g %.20g %.20g \",\n",(double) image->columns,(double)
+    "\"%.17g %.17g %.17g %.17g \",\n",(double) image->columns,(double)
     image->rows,(double) image->colors,(double) characters_per_pixel);
   (void) WriteBlobString(image,buffer);
   GetPixelInfo(image,&pixel);
diff --git a/coders/xps.c b/coders/xps.c
index 63e5395c4..35f16cd9a 100644
--- a/coders/xps.c
+++ b/coders/xps.c
@@ -273,7 +273,7 @@ static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if (image_info->ping != MagickFalse)
     (void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0");
   else
-    (void) FormatLocaleString(options,MagickPathExtent,"-g%.20gx%.20g ",
+    (void) FormatLocaleString(options,MagickPathExtent,"-g%.17gx%.17g ",
       (double) page.width,(double) page.height);
   read_info=CloneImageInfo(image_info);
   *read_info->magick='\0';
@@ -282,8 +282,8 @@ static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
       char
         pages[MagickPathExtent];

-      (void) FormatLocaleString(pages,MagickPathExtent,"-dFirstPage=%.20g "
-        "-dLastPage=%.20g ",(double) read_info->scene+1,(double)
+      (void) FormatLocaleString(pages,MagickPathExtent,"-dFirstPage=%.17g "
+        "-dLastPage=%.17g ",(double) read_info->scene+1,(double)
         (read_info->scene+read_info->number_scenes));
       (void) ConcatenateMagickString(options,pages,MagickPathExtent);
       read_info->number_scenes=0;
diff --git a/coders/yaml.c b/coders/yaml.c
index b3dc3559d..65c0aeb0f 100644
--- a/coders/yaml.c
+++ b/coders/yaml.c
@@ -599,8 +599,8 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image,
             break;
           if (n != 0)
             (void) FormatLocaleFile(file,"\n");
-          (void) FormatLocaleFile(file,"        location%.20g: \n"
-            "          x: %.20g\n          y: %.20g\n"
+          (void) FormatLocaleFile(file,"        location%.17g: \n"
+            "          x: %.17g\n          y: %.17g\n"
             "        ",(double) n,(double) x,(double) y);
           n++;
         }
@@ -644,9 +644,9 @@ static ssize_t PrintChannelMoments(FILE *file,const PixelChannel channel,
   n+=FormatLocaleFile(file,"        ellipseIntensity: %.*g\n",
     GetMagickPrecision(),channel_moments[channel].ellipse_intensity);
   for (i=0; i < 7; i++)
-    n+=FormatLocaleFile(file,"        I%.20g: %.*g\n",i+1.0,
+    n+=FormatLocaleFile(file,"        I%.17g: %.*g\n",i+1.0,
       GetMagickPrecision(),channel_moments[channel].invariant[i]);
-  n+=FormatLocaleFile(file,"        I%.20g: %.*g\n",i+1.0,
+  n+=FormatLocaleFile(file,"        I%.17g: %.*g\n",i+1.0,
     GetMagickPrecision(),channel_moments[channel].invariant[i]);
   (void) FormatLocaleFile(file,"      ");
   if (separator != MagickFalse)
@@ -680,13 +680,13 @@ static ssize_t PrintChannelPerceptualHash(Image *image,FILE *file,
     PixelTrait traits = GetPixelChannelTraits(image,channel);
     if (traits == UndefinedPixelTrait)
       continue;
-    n=FormatLocaleFile(file,"      Channel%.20g: \n",(double) channel);
+    n=FormatLocaleFile(file,"      Channel%.17g: \n",(double) channel);
     for (j=0; j < MaximumNumberOfPerceptualHashes; j++)
     {
       ssize_t
         k;

-      n+=FormatLocaleFile(file,"        PH%.20g: ",(double) j+1);
+      n+=FormatLocaleFile(file,"        PH%.17g: ",(double) j+1);
       for (k=0; k < (ssize_t) channel_phash[0].number_colorspaces; k++)
       {
         n+=FormatLocaleFile(file,"- %.*g",GetMagickPrecision(),
@@ -879,7 +879,7 @@ static void EncodeIptcProfile(FILE *file,const StringInfo *profile)
       for (i=0; i < (ssize_t) count; i++)
       {
         value=values[i];
-        (void) FormatLocaleFile(file,"        %s[%.20g,%.20g]: ",
+        (void) FormatLocaleFile(file,"        %s[%.17g,%.17g]: ",
           value->tag,(double) value->dataset,(double) value->record);
         if (value->values_length == 0)
           (void) FormatLocaleFile(file,"null,");
@@ -1156,37 +1156,37 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
     image->depth);
   (void) FormatLocaleFile(file,"    channelDepth: \n");
   if (image->alpha_trait != UndefinedPixelTrait)
-    (void) FormatLocaleFile(file,"      alpha: %.20g\n",(double)
+    (void) FormatLocaleFile(file,"      alpha: %.17g\n",(double)
       channel_statistics[AlphaPixelChannel].depth);
   switch (image->colorspace)
   {
     case RGBColorspace:
     default:
     {
-      (void) FormatLocaleFile(file,"      red: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      red: %.17g\n",(double)
         channel_statistics[RedChannel].depth);
-      (void) FormatLocaleFile(file,"      green: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      green: %.17g\n",(double)
         channel_statistics[GreenChannel].depth);
-      (void) FormatLocaleFile(file,"      blue: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      blue: %.17g\n",(double)
         channel_statistics[BlueChannel].depth);
       break;
     }
     case CMYKColorspace:
     {
-      (void) FormatLocaleFile(file,"      cyan: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      cyan: %.17g\n",(double)
         channel_statistics[CyanChannel].depth);
-      (void) FormatLocaleFile(file,"      magenta: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      magenta: %.17g\n",(double)
         channel_statistics[MagentaChannel].depth);
-      (void) FormatLocaleFile(file,"      yellow: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      yellow: %.17g\n",(double)
         channel_statistics[YellowChannel].depth);
-      (void) FormatLocaleFile(file,"      black: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      black: %.17g\n",(double)
         channel_statistics[BlackChannel].depth);
       break;
     }
     case LinearGRAYColorspace:
     case GRAYColorspace:
     {
-      (void) FormatLocaleFile(file,"      gray: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"      gray: %.17g\n",(double)
         channel_statistics[GrayChannel].depth);
       break;
     }
@@ -1198,7 +1198,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
       MAGICKCORE_QUANTUM_DEPTH-image->depth)));
   if (channel_statistics != (ChannelStatistics *) NULL)
     {
-      (void) FormatLocaleFile(file,"    pixels: %.20g\n",
+      (void) FormatLocaleFile(file,"    pixels: %.17g\n",
         channel_statistics[CompositePixelChannel].area);
       if ((image->colorspace != LinearGRAYColorspace) &&
           (image->colorspace != GRAYColorspace))
@@ -1384,7 +1384,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
       PixelInfo
         *magick_restrict p;

-      (void) FormatLocaleFile(file,"    colormapEntries: %.20g\n",
+      (void) FormatLocaleFile(file,"    colormapEntries: %.17g\n",
         (double) image->colors);
       (void) FormatLocaleFile(file,"    colormap: \n      ");
       p=image->colormap;
@@ -1436,8 +1436,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
     }
   if ((image->extract_info.width*image->extract_info.height) != 0)
     (void) FormatLocaleFile(file,"    tileGeometry: \n"
-      "      width: %.20g\n      height: %.20g\n"
-      "      x: %.20g\n      y: %.20g\n    \n",
+      "      width: %.17g\n      height: %.17g\n"
+      "      x: %.17g\n      y: %.17g\n    \n",
       (double) image->extract_info.width,(double) image->extract_info.height,
       (double) image->extract_info.x,(double) image->extract_info.y);
   GetColorTuple(&image->matte_color,MagickTrue,color);
@@ -1457,8 +1457,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
   if ((image->page.width != 0) || (image->page.height != 0) ||
       (image->page.x != 0) || (image->page.y != 0))
     (void) FormatLocaleFile(file,"    pageGeometry: \n"
-      "      width: %.20g\n      height: %.20g\n"
-      "      x: %.20g\n      y: %.20g\n    \n",
+      "      width: %.17g\n      height: %.17g\n"
+      "      x: %.17g\n      y: %.17g\n    \n",
       (double) image->page.width,(double) image->page.height,
       (double) image->page.x,(double) image->page.y);
   if ((image->page.x != 0) || (image->page.y != 0))
@@ -1467,23 +1467,23 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
   YAMLFormatLocaleFile(file,"    dispose: %s\n",
     CommandOptionToMnemonic(MagickDisposeOptions,(ssize_t) image->dispose));
   if (image->delay != 0)
-    (void) FormatLocaleFile(file,"    delay: %.20gx%.20g\n",
+    (void) FormatLocaleFile(file,"    delay: %.17gx%.17g\n",
       (double) image->delay,(double) image->ticks_per_second);
   if (image->iterations != 1)
-    (void) FormatLocaleFile(file,"    iterations: %.20g\n",(double)
+    (void) FormatLocaleFile(file,"    iterations: %.17g\n",(double)
       image->iterations);
   if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
-    (void) FormatLocaleFile(file,"    scene: %.20g\n    scenes: "
-      "%.20g\n",(double) image->scene,(double) GetImageListLength(image));
+    (void) FormatLocaleFile(file,"    scene: %.17g\n    scenes: "
+      "%.17g\n",(double) image->scene,(double) GetImageListLength(image));
   else
     if (image->scene != 0)
-      (void) FormatLocaleFile(file,"    scene: %.20g\n",(double)
+      (void) FormatLocaleFile(file,"    scene: %.17g\n",(double)
         image->scene);
   YAMLFormatLocaleFile(file,"    compression: %s\n",
     CommandOptionToMnemonic(MagickCompressOptions,(ssize_t)
     image->compression));
   if (image->quality != UndefinedCompressionQuality)
-    (void) FormatLocaleFile(file,"    quality: %.20g\n",(double)
+    (void) FormatLocaleFile(file,"    quality: %.17g\n",(double)
       image->quality);
   YAMLFormatLocaleFile(file,"    orientation: %s\n",
     CommandOptionToMnemonic(MagickOrientationOptions,(ssize_t)
@@ -1529,7 +1529,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
             (void) FormatLocaleFile(file,"    ");
             continue;
           }
-        (void) FormatLocaleFile(file,"\n       - info: %.20gx%.20g %s",
+        (void) FormatLocaleFile(file,"\n       - info: %.17gx%.17g %s",
           (double) tile->magick_columns,(double) tile->magick_rows,
           tile->magick);
         (void) SignatureImage(tile,exception);
@@ -1605,7 +1605,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
         YAMLFormatLocaleFile(file,"      %s: \n",name);
         if (LocaleCompare(name,"iptc") == 0)
           EncodeIptcProfile(file,profile);
-        (void) FormatLocaleFile(file,"        length: %.20g",(double)
+        (void) FormatLocaleFile(file,"        length: %.17g",(double)
           GetStringInfoLength(profile));
         (void) FormatLocaleFile(file,"\n      ");
         name=GetNextImageProfile(image);
diff --git a/tests/validate.c b/tests/validate.c
index e97e0d5c8..bf36d20e0 100644
--- a/tests/validate.c
+++ b/tests/validate.c
@@ -560,7 +560,7 @@ static size_t ValidateColorspaces(size_t *fails,ExceptionInfo *exception)
   for (test=0; test < 26; test++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: ",(double) test);
+    (void) FormatLocaleFile(stdout,"  test %.17g: ",(double) test);
     switch (test)
     {
       case  0: status=ValidateHSIToRGB(); break;
@@ -601,7 +601,7 @@ static size_t ValidateColorspaces(size_t *fails,ExceptionInfo *exception)
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -668,7 +668,7 @@ static size_t ValidateCompareCommand(ImageInfo *image_info,
   for (i=0; compare_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) (test++),
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) (test++),
       compare_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s %s %s",
       compare_options[i],reference_filename,reference_filename,output_filename);
@@ -699,7 +699,7 @@ static size_t ValidateCompareCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -766,7 +766,7 @@ static size_t ValidateCompositeCommand(ImageInfo *image_info,
   for (i=0; composite_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) (test++),
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) (test++),
       composite_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s %s %s",
       reference_filename,composite_options[i],reference_filename,
@@ -794,7 +794,7 @@ static size_t ValidateCompositeCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -861,7 +861,7 @@ static size_t ValidateConvertCommand(ImageInfo *image_info,
   for (i=0; convert_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) test++,
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) test++,
       convert_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s %s %s",
       reference_filename,convert_options[i],reference_filename,output_filename);
@@ -888,7 +888,7 @@ static size_t ValidateConvertCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -956,7 +956,7 @@ static size_t ValidateIdentifyCommand(ImageInfo *image_info,
   for (i=0; identify_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) test++,
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) test++,
       identify_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s",
       identify_options[i],reference_filename);
@@ -983,7 +983,7 @@ static size_t ValidateIdentifyCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -1092,7 +1092,7 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info,
         Generate reference image.
       */
       CatchException(exception);
-      (void) FormatLocaleFile(stdout,"  test %.20g: %s/%s/%s/%.20g-bits",
+      (void) FormatLocaleFile(stdout,"  test %.17g: %s/%s/%s/%.17g-bits",
         (double) (test++),reference_formats[i].magick,CommandOptionToMnemonic(
         MagickCompressOptions,reference_formats[i].compression),
         CommandOptionToMnemonic(MagickTypeOptions,reference_types[j].type),
@@ -1114,7 +1114,7 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info,
       /*
         Write reference image.
       */
-      (void) FormatLocaleString(size,MagickPathExtent,"%.20gx%.20g",
+      (void) FormatLocaleString(size,MagickPathExtent,"%.17gx%.17g",
         (double) reference_image->columns,(double) reference_image->rows);
       (void) CloneString(&image_info->size,size);
       image_info->depth=reference_types[j].depth;
@@ -1292,7 +1292,7 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info,
     }
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -1377,7 +1377,7 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info,
         Generate reference image.
       */
       CatchException(exception);
-      (void) FormatLocaleFile(stdout,"  test %.20g: %s/%s/%s/%.20g-bits",
+      (void) FormatLocaleFile(stdout,"  test %.17g: %s/%s/%s/%.17g-bits",
         (double) (test++),reference_formats[i].magick,CommandOptionToMnemonic(
         MagickCompressOptions,reference_formats[i].compression),
         CommandOptionToMnemonic(MagickTypeOptions,reference_types[j].type),
@@ -1399,7 +1399,7 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info,
       /*
         Write reference image.
       */
-      (void) FormatLocaleString(size,MagickPathExtent,"%.20gx%.20g",
+      (void) FormatLocaleString(size,MagickPathExtent,"%.17gx%.17g",
         (double) reference_image->columns,(double) reference_image->rows);
       (void) CloneString(&image_info->size,size);
       image_info->depth=reference_types[j].depth;
@@ -1519,7 +1519,7 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info,
     }
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -1600,7 +1600,7 @@ static size_t ValidateImportExportPixels(ImageInfo *image_info,
         Generate reference image.
       */
       CatchException(exception);
-      (void) FormatLocaleFile(stdout,"  test %.20g: %s/%s",(double) (test++),
+      (void) FormatLocaleFile(stdout,"  test %.17g: %s/%s",(double) (test++),
         reference_map[i],CommandOptionToMnemonic(MagickStorageOptions,
         reference_storage[j].type));
       (void) CopyMagickString(image_info->filename,reference_filename,
@@ -1708,7 +1708,7 @@ static size_t ValidateImportExportPixels(ImageInfo *image_info,
     }
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -1775,7 +1775,7 @@ static size_t ValidateMagickCommand(ImageInfo *image_info,
   for (i=0; convert_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) test++,
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) test++,
       convert_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s %s %s",
       reference_filename,convert_options[i],reference_filename,output_filename);
@@ -1802,7 +1802,7 @@ static size_t ValidateMagickCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -1869,7 +1869,7 @@ static size_t ValidateMontageCommand(ImageInfo *image_info,
   for (i=0; montage_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) (test++),
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) (test++),
       montage_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s %s %s",
       reference_filename,montage_options[i],reference_filename,
@@ -1897,7 +1897,7 @@ static size_t ValidateMontageCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -1964,7 +1964,7 @@ static size_t ValidateStreamCommand(ImageInfo *image_info,
   for (i=0; stream_options[i] != (char *) NULL; i++)
   {
     CatchException(exception);
-    (void) FormatLocaleFile(stdout,"  test %.20g: %s",(double) (test++),
+    (void) FormatLocaleFile(stdout,"  test %.17g: %s",(double) (test++),
       stream_options[i]);
     (void) FormatLocaleString(command,MagickPathExtent,"%s %s %s",
       stream_options[i],reference_filename,output_filename);
@@ -1991,7 +1991,7 @@ static size_t ValidateStreamCommand(ImageInfo *image_info,
     (void) FormatLocaleFile(stdout,"... pass.\n");
   }
   (void) FormatLocaleFile(stdout,
-    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    "  summary: %.17g subtests; %.17g passed; %.17g failed.\n",(double) test,
     (double) (test-fail),(double) fail);
   *fails+=fail;
   return(test);
@@ -2300,7 +2300,7 @@ int main(int argc,char **argv)
             tests+=ValidateStreamCommand(image_info,reference_filename,
               output_filename,&fail,exception);
           (void) FormatLocaleFile(stdout,
-            "validation suite: %.20g tests; %.20g passed; %.20g failed.\n",
+            "validation suite: %.17g tests; %.17g passed; %.17g failed.\n",
             (double) tests,(double) (tests-fail),(double) fail);
         }
       (void) RelinquishUniqueFileResource(output_filename);
@@ -2315,7 +2315,7 @@ int main(int argc,char **argv)
       elapsed_time=GetElapsedTime(timer);
       user_time=GetUserTime(timer);
       (void) FormatLocaleFile(stderr,
-        "Performance: %.20gi %.3fips %0.6fu %ld:%02ld.%03ld\n",(double)
+        "Performance: %.17gi %.3fips %0.6fu %ld:%02ld.%03ld\n",(double)
         iterations,1.0*iterations/elapsed_time,user_time,(long)
         (elapsed_time/60.0),(long) ceil(fmod(elapsed_time,60.0)),
         (long) (1000.0*(elapsed_time-floor(elapsed_time))));
diff --git a/tests/wandtest.c b/tests/wandtest.c
index bf9f11221..824403455 100644
--- a/tests/wandtest.c
+++ b/tests/wandtest.c
@@ -5238,17 +5238,17 @@ int main(int argc,char **argv)
   if (status == MagickFalse)
     ThrowAPIException(magick_wand);
   if (MagickGetNumberImages(magick_wand) != 5)
-    (void) FormatLocaleFile(stderr,"read %.20g images; expected 5\n",
+    (void) FormatLocaleFile(stderr,"read %.17g images; expected 5\n",
       (double) MagickGetNumberImages(magick_wand));
   (void) FormatLocaleFile(stdout,"Iterate forward...\n");
   MagickResetIterator(magick_wand);
   while (MagickNextImage(magick_wand) != MagickFalse)
-    (void) FormatLocaleFile(stdout,"index %.20g scene %.20g\n",(double)
+    (void) FormatLocaleFile(stdout,"index %.17g scene %.17g\n",(double)
       MagickGetIteratorIndex(magick_wand),(double)
       MagickGetImageScene(magick_wand));
   (void) FormatLocaleFile(stdout,"Iterate reverse...\n");
   while (MagickPreviousImage(magick_wand) != MagickFalse)
-    (void) FormatLocaleFile(stdout,"index %.20g scene %.20g\n",(double)
+    (void) FormatLocaleFile(stdout,"index %.17g scene %.17g\n",(double)
       MagickGetIteratorIndex(magick_wand),(double)
       MagickGetImageScene(magick_wand));
   (void) FormatLocaleFile(stdout,"Remove scene 1...\n");
@@ -5259,7 +5259,7 @@ int main(int argc,char **argv)
     ThrowAPIException(magick_wand);
   MagickResetIterator(magick_wand);
   while (MagickNextImage(magick_wand) != MagickFalse)
-    (void) FormatLocaleFile(stdout,"index %.20g scene %.20g\n",(double)
+    (void) FormatLocaleFile(stdout,"index %.17g scene %.17g\n",(double)
       MagickGetIteratorIndex(magick_wand),(double)
       MagickGetImageScene(magick_wand));
   (void) FormatLocaleFile(stdout,"Insert scene 1 back in sequence...\n");
@@ -5269,7 +5269,7 @@ int main(int argc,char **argv)
     ThrowAPIException(magick_wand);
   MagickResetIterator(magick_wand);
   while (MagickNextImage(magick_wand) != MagickFalse)
-    (void) FormatLocaleFile(stdout,"index %.20g scene %.20g\n",(double)
+    (void) FormatLocaleFile(stdout,"index %.17g scene %.17g\n",(double)
       MagickGetIteratorIndex(magick_wand),(double)
       MagickGetImageScene(magick_wand));
   (void) FormatLocaleFile(stdout,"Set scene 2 to scene 1...\n");
@@ -5280,7 +5280,7 @@ int main(int argc,char **argv)
     ThrowAPIException(magick_wand);
   MagickResetIterator(magick_wand);
   while (MagickNextImage(magick_wand) != MagickFalse)
-    (void) FormatLocaleFile(stdout,"index %.20g scene %.20g\n",(double)
+    (void) FormatLocaleFile(stdout,"index %.17g scene %.17g\n",(double)
       MagickGetIteratorIndex(magick_wand),(double)
       MagickGetImageScene(magick_wand));
   (void) FormatLocaleFile(stdout,"Apply image processing options...\n");