diff options
| author | Paul Eggert | 2017-03-19 12:29:06 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-03-19 12:29:06 -0700 |
| commit | e6fd84d2d5ca256797ff210c915a2fa773d4d742 (patch) | |
| tree | ba2ba64a65705a3259a0ecb66098f834e741fb4b /doc/lispref/strings.texi | |
| parent | d86bcedd880b3cb6383641082d406075aa6e70e2 (diff) | |
| parent | ab0a60a1b334fafc7d805eb44e6069ea314ad486 (diff) | |
| download | emacs-e6fd84d2d5ca256797ff210c915a2fa773d4d742.tar.gz emacs-e6fd84d2d5ca256797ff210c915a2fa773d4d742.zip | |
Merge from origin/emacs-25
ab0a60a ; * CONTRIBUTE (Generating ChangeLog entries): Drop duplicate...
7e02a47 Index byte-compile-debug
7c1e598 Document `byte-compile-debug' in the ELisp manual
4d81eb4 Document variable `byte-compile-debug'
72ef710 Fix call to debugger on assertion failure
ae8264c Call modification hooks in org-src fontify buffers
b3139da ; Fix last change in doc/lispref/strings.texi
c331f39 Improve documentation of 'format' conversions
9f52f67 Remove stale functions from ert manual
c416b14 Fix a typo in Eshell manual
06695a0 ; Fix a typo in ediff-merg.el
954e9e9 Improve documentation of hooks related to saving buffers
9fcab85 Improve documentation of auto-save-visited-file-name
2236c53 fix typo in mailcap-mime-extensions
85a3e4e Fix typos in flymake.el
a1ef10e More NEWS checking for admin.el's set-version
# Conflicts:
# lisp/emacs-lisp/bytecomp.el
Diffstat (limited to 'doc/lispref/strings.texi')
| -rw-r--r-- | doc/lispref/strings.texi | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index cf47db4a814..ae2b31c5418 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -901,17 +901,18 @@ Functions}). Thus, strings are enclosed in @samp{"} characters, and | |||
| 901 | @item %o | 901 | @item %o |
| 902 | @cindex integer to octal | 902 | @cindex integer to octal |
| 903 | Replace the specification with the base-eight representation of an | 903 | Replace the specification with the base-eight representation of an |
| 904 | integer. | 904 | unsigned integer. |
| 905 | 905 | ||
| 906 | @item %d | 906 | @item %d |
| 907 | Replace the specification with the base-ten representation of an | 907 | Replace the specification with the base-ten representation of a signed |
| 908 | integer. | 908 | integer. |
| 909 | 909 | ||
| 910 | @item %x | 910 | @item %x |
| 911 | @itemx %X | 911 | @itemx %X |
| 912 | @cindex integer to hexadecimal | 912 | @cindex integer to hexadecimal |
| 913 | Replace the specification with the base-sixteen representation of an | 913 | Replace the specification with the base-sixteen representation of an |
| 914 | integer. @samp{%x} uses lower case and @samp{%X} uses upper case. | 914 | unsigned integer. @samp{%x} uses lower case and @samp{%X} uses upper |
| 915 | case. | ||
| 915 | 916 | ||
| 916 | @item %c | 917 | @item %c |
| 917 | Replace the specification with the character which is the value given. | 918 | Replace the specification with the character which is the value given. |
| @@ -926,8 +927,12 @@ floating-point number. | |||
| 926 | 927 | ||
| 927 | @item %g | 928 | @item %g |
| 928 | Replace the specification with notation for a floating-point number, | 929 | Replace the specification with notation for a floating-point number, |
| 929 | using either exponential notation or decimal-point notation, whichever | 930 | using either exponential notation or decimal-point notation. The |
| 930 | is shorter. | 931 | exponential notation is used if the exponent would be less than -4 or |
| 932 | greater than or equal to the precision (default: 6). By default, | ||
| 933 | trailing zeros are removed from the fractional portion of the result | ||
| 934 | and a decimal-point character appears only if it is followed by a | ||
| 935 | digit. | ||
| 931 | 936 | ||
| 932 | @item %% | 937 | @item %% |
| 933 | Replace the specification with a single @samp{%}. This format | 938 | Replace the specification with a single @samp{%}. This format |
| @@ -1008,9 +1013,11 @@ both flags are used, @samp{+} takes precedence. | |||
| 1008 | The flag @samp{#} specifies an alternate form which depends on | 1013 | The flag @samp{#} specifies an alternate form which depends on |
| 1009 | the format in use. For @samp{%o}, it ensures that the result begins | 1014 | the format in use. For @samp{%o}, it ensures that the result begins |
| 1010 | with a @samp{0}. For @samp{%x} and @samp{%X}, it prefixes the result | 1015 | with a @samp{0}. For @samp{%x} and @samp{%X}, it prefixes the result |
| 1011 | with @samp{0x} or @samp{0X}. For @samp{%e}, @samp{%f}, and @samp{%g}, | 1016 | with @samp{0x} or @samp{0X}. For @samp{%e} and @samp{%f}, the |
| 1012 | the @samp{#} flag means include a decimal point even if the precision | 1017 | @samp{#} flag means include a decimal point even if the precision is |
| 1013 | is zero. | 1018 | zero. For @samp{%g}, it always includes a decimal point, and also |
| 1019 | forces any trailing zeros after the decimal point to be left in place | ||
| 1020 | where they would otherwise be removed. | ||
| 1014 | 1021 | ||
| 1015 | The flag @samp{0} ensures that the padding consists of @samp{0} | 1022 | The flag @samp{0} ensures that the padding consists of @samp{0} |
| 1016 | characters instead of spaces. This flag is ignored for non-numerical | 1023 | characters instead of spaces. This flag is ignored for non-numerical |
| @@ -1041,10 +1048,14 @@ ignored. | |||
| 1041 | All the specification characters allow an optional @dfn{precision} | 1048 | All the specification characters allow an optional @dfn{precision} |
| 1042 | before the character (after the width, if present). The precision is | 1049 | before the character (after the width, if present). The precision is |
| 1043 | a decimal-point @samp{.} followed by a digit-string. For the | 1050 | a decimal-point @samp{.} followed by a digit-string. For the |
| 1044 | floating-point specifications (@samp{%e}, @samp{%f}, @samp{%g}), the | 1051 | floating-point specifications (@samp{%e} and @samp{%f}), the |
| 1045 | precision specifies how many decimal places to show; if zero, the | 1052 | precision specifies how many digits following the decimal point to |
| 1046 | decimal-point itself is also omitted. For @samp{%s} and @samp{%S}, | 1053 | show; if zero, the decimal-point itself is also omitted. For |
| 1047 | the precision truncates the string to the given width, so @samp{%.3s} | 1054 | @samp{%g}, the precision specifies how many significant digits to show |
| 1055 | (significant digits are the first digit before the decimal point and | ||
| 1056 | all the digits after it). If the precision of %g is zero or | ||
| 1057 | unspecified, it is treated as 1. For @samp{%s} and @samp{%S}, the | ||
| 1058 | precision truncates the string to the given width, so @samp{%.3s} | ||
| 1048 | shows only the first three characters of the representation for | 1059 | shows only the first three characters of the representation for |
| 1049 | @var{object}. For other specification characters, the effect of | 1060 | @var{object}. For other specification characters, the effect of |
| 1050 | precision is what the local library functions of the @code{printf} | 1061 | precision is what the local library functions of the @code{printf} |