diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-09-04 14:37:15 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-09-04 14:37:15 +0300 |
commit | 2b7501cc7c765b22c893409b4087b31fdbd9ac14 (patch) | |
tree | accb7eff8ba3c928042066dedd36ea919c16fc2d /profile.c | |
parent | 0d974ba125c1e8df68fecc2f579bb067d056cc3f (diff) | |
parent | 26ab51cc70109abd04ac04ff75bb58abb2eb957f (diff) | |
download | egawk-2b7501cc7c765b22c893409b4087b31fdbd9ac14.tar.gz egawk-2b7501cc7c765b22c893409b4087b31fdbd9ac14.tar.bz2 egawk-2b7501cc7c765b22c893409b4087b31fdbd9ac14.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1459,9 +1459,19 @@ pp_number(NODE *n) } else #endif { - count = PP_PRECISION + 10; - emalloc(str, char *, count, "pp_number"); - sprintf(str, "%0.*g", PP_PRECISION, n->numbr); + /* Use format_val() to get integral values printed as integers */ + NODE *s; + + getnode(s); + *s = *n; + s->flags &= ~STRCUR; + + s = r_format_val("%.6g", 0, s); + + s->stptr[s->stlen] = '\0'; + str = s->stptr; + + freenode(s); } return str; |