/[pspp]/pspp/src/data-out.c
ViewVC logotype

Diff of /pspp/src/data-out.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by jmd, Tue May 17 13:53:38 2005 UTC revision 1.18 by blp, Wed May 18 01:30:56 2005 UTC
# Line 1116  format_and_round (char *dst, double numb Line 1116  format_and_round (char *dst, double numb
1116    
1117    sprintf (buf, "%.*f", decimals, number);    sprintf (buf, "%.*f", decimals, number);
1118    
1119      /* Omit integer part if it's 0. */
1120    if (!memcmp (buf, "0.", 2))    if (!memcmp (buf, "0.", 2))
1121      memmove (buf, buf + 1, strlen (buf));      memmove (buf, buf + 1, strlen (buf));
1122    else if (!memcmp (buf, "-0.", 3))    else if (!memcmp (buf, "-0.", 3))
# Line 1215  format_and_round (char *dst, double numb Line 1216  format_and_round (char *dst, double numb
1216          }          }
1217      }      }
1218    
1219      /* Omit `-' if value output is zero. */
1220      if (buf[0] == '-' && buf[strspn (buf, "-.0")] == '\0')
1221        memmove (buf, buf + 1, strlen (buf));
1222    
1223    buf_copy_str_lpad (dst, fp->w, buf);    buf_copy_str_lpad (dst, fp->w, buf);
1224    return 1;    return 1;
1225  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26