aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 395b3f3faed..18384a7d03a 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3823,12 +3823,14 @@ The format control string may contain %-sequences meaning to substitute
3823the next available argument: 3823the next available argument:
3824 3824
3825%s means print a string argument. Actually, prints any object, with `princ'. 3825%s means print a string argument. Actually, prints any object, with `princ'.
3826%d means print as number in decimal (%o octal, %x hex). 3826%d means print as signed number in decimal.
3827%o means print as unsigned number in octal, %x as unsigned number in hex.
3827%X is like %x, but uses upper case. 3828%X is like %x, but uses upper case.
3828%e means print a number in exponential notation. 3829%e means print a number in exponential notation.
3829%f means print a number in decimal-point notation. 3830%f means print a number in decimal-point notation.
3830%g means print a number in exponential notation 3831%g means print a number in exponential notation if the exponent would be
3831 or decimal-point notation, whichever uses fewer characters. 3832 less than -4 or greater than or equal to the precision (default: 6);
3833 otherwise it prints in decimal-point notation.
3832%c means print a number as a single character. 3834%c means print a number as a single character.
3833%S means print any object as an s-expression (using `prin1'). 3835%S means print any object as an s-expression (using `prin1').
3834 3836
@@ -3851,8 +3853,10 @@ The - and 0 flags affect the width specifier, as described below.
3851The # flag means to use an alternate display form for %o, %x, %X, %e, 3853The # flag means to use an alternate display form for %o, %x, %X, %e,
3852%f, and %g sequences: for %o, it ensures that the result begins with 3854%f, and %g sequences: for %o, it ensures that the result begins with
3853\"0\"; for %x and %X, it prefixes the result with \"0x\" or \"0X\"; 3855\"0\"; for %x and %X, it prefixes the result with \"0x\" or \"0X\";
3854for %e, %f, and %g, it causes a decimal point to be included even if 3856for %e and %f, it causes a decimal point to be included even if the
3855the precision is zero. 3857the precision is zero; for %g, it causes a decimal point to be
3858included even if the the precision is zero, and also forces trailing
3859zeros after the decimal point to be left in place.
3856 3860
3857The width specifier supplies a lower limit for the length of the 3861The width specifier supplies a lower limit for the length of the
3858printed representation. The padding, if any, normally goes on the 3862printed representation. The padding, if any, normally goes on the
@@ -3861,10 +3865,12 @@ character is normally a space, but it is 0 if the 0 flag is present.
3861The 0 flag is ignored if the - flag is present, or the format sequence 3865The 0 flag is ignored if the - flag is present, or the format sequence
3862is something other than %d, %e, %f, and %g. 3866is something other than %d, %e, %f, and %g.
3863 3867
3864For %e, %f, and %g sequences, the number after the "." in the 3868For %e and %f sequences, the number after the "." in the precision
3865precision specifier says how many decimal places to show; if zero, the 3869specifier says how many decimal places to show; if zero, the decimal
3866decimal point itself is omitted. For %s and %S, the precision 3870point itself is omitted. For %g, the precision specifies how many
3867specifier truncates the string to the given width. 3871significant digits to print; zero or omitted are treated as 1.
3872For %s and %S, the precision specifier truncates the string to the
3873given width.
3868 3874
3869usage: (format STRING &rest OBJECTS) */) 3875usage: (format STRING &rest OBJECTS) */)
3870 (ptrdiff_t nargs, Lisp_Object *args) 3876 (ptrdiff_t nargs, Lisp_Object *args)