diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-05-14 00:23:07 +0200 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-05-20 14:18:14 +0200 |
commit | 182b48aa777a2c9c453f729c162412b6900b055d (patch) | |
tree | ffa576ffbca23f1202fddee1dd66d2278edaadc5 /doc/api/util.md | |
parent | 32fb7d93348c9d2d70bb4450913e22c68a7e76ca (diff) | |
download | android-node-v8-182b48aa777a2c9c453f729c162412b6900b055d.tar.gz android-node-v8-182b48aa777a2c9c453f729c162412b6900b055d.tar.bz2 android-node-v8-182b48aa777a2c9c453f729c162412b6900b055d.zip |
doc: update `util.format` formatters documentation
This includes the information that some inputs are handled
differently than others (e.g., `Symbols` are partially represented
as `NaN`).
PR-URL: https://github.com/nodejs/node/pull/27621
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r-- | doc/api/util.md | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index c0b909d438..e0b30e9a97 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -220,13 +220,15 @@ as a `printf`-like format string which can contain zero or more format specifiers. Each specifier is replaced with the converted value from the corresponding argument. Supported specifiers are: -* `%s` - `String` will be used to convert all values except `BigInt` and - `Object`. `BigInt` values will be represented with an `n` and Objects are +* `%s` - `String` will be used to convert all values except `BigInt`, `Object` + and `-0`. `BigInt` values will be represented with an `n` and Objects are inspected using `util.inspect()` with options - `{ depth: 0, colors: false, compact: 3 }`. -* `%d` - `Number` will be used to convert all values except `BigInt`. -* `%i` - `parseInt(value, 10)` is used for all values except `BigInt`. -* `%f` - `parseFloat(value)` is used for all values. + `{ depth: 0, colors: false, compact: 3 }`. +* `%d` - `Number` will be used to convert all values except `BigInt` and + `Symbol`. +* `%i` - `parseInt(value, 10)` is used for all values except `BigInt` and + `Symbol`. +* `%f` - `parseFloat(value)` is used for all values expect `Symbol`. * `%j` - JSON. Replaced with the string `'[Circular]'` if the argument contains circular references. * `%o` - `Object`. A string representation of an object with generic JavaScript |