changeset 1764:94ff5d9ef48a

(float_to_string): Add final 0 if text ends with decimal pt.
author Richard M. Stallman <rms@gnu.org>
date Wed, 13 Jan 1993 00:25:03 +0000
parents 65e858c07a8b
children 1cc3ee5afc82
files src/print.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/print.c	Tue Jan 12 00:12:21 1993 +0000
+++ b/src/print.c	Wed Jan 13 00:25:03 1993 +0000
@@ -640,12 +640,18 @@
       sprintf (buf, XSTRING (Vfloat_output_format)->data, data);
     }
 
-  /* Make sure there is a decimal point or an exponent,
+  /* Make sure there is a decimal point with digit after, or an exponent,
      so that the value is readable as a float.  */
   for (cp = buf; *cp; cp++)
     if (*cp < '0' || *cp > '9')
       break;
 
+  if (*cp == '.' && cp[1] == 0)
+    {
+      cp[1] = '0';
+      cp[2] = 0;
+    }
+
   if (*cp == 0)
     {
       *cp++ = '.';