diff options
author | Roman Reiss <me@silverwind.io> | 2016-12-16 21:20:15 +0100 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2017-03-29 07:12:05 +0200 |
commit | a46c43d21a6c9980c5c1cdafc21be7c96dec1ad5 (patch) | |
tree | adc03f699a16dac8a16f39c5bbe051d423f48ccb /doc | |
parent | 1fde98bb4fa5cab0d060994768ebd055ce6fbf2c (diff) | |
download | android-node-v8-a46c43d21a6c9980c5c1cdafc21be7c96dec1ad5.tar.gz android-node-v8-a46c43d21a6c9980c5c1cdafc21be7c96dec1ad5.tar.bz2 android-node-v8-a46c43d21a6c9980c5c1cdafc21be7c96dec1ad5.zip |
util: add %i and %f formatting specifiers
This change brings formatting specifiers available in `util.format` and
consequently, `console.*` closer to what is supported in all major
browsers.
- `%i` is introduced to format integer values.
- `%f` is introduced to format floating point values.
Fixes: https://github.com/nodejs/node/issues/10292
PR-URL: https://github.com/nodejs/node/pull/10308
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/util.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index bb1bbd529a..357811cc0f 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -103,7 +103,9 @@ Each placeholder token is replaced with the converted value from the corresponding argument. Supported placeholders are: * `%s` - String. -* `%d` - Number (both integer and float). +* `%d` - Number (integer or floating point value). +* `%i` - Integer. +* `%f` - Floating point value. * `%j` - JSON. Replaced with the string `'[Circular]'` if the argument contains circular references. * `%%` - single percent sign (`'%'`). This does not consume an argument. |