Skip to content

Commit 378f44c

Browse files
BridgeARtargos
authored andcommitted
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: #27621 Reviewed-By: Roman Reiss <[email protected]>
1 parent 5205902 commit 378f44c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/api/util.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,15 @@ as a `printf`-like format string which can contain zero or more format
220220
specifiers. Each specifier is replaced with the converted value from the
221221
corresponding argument. Supported specifiers are:
222222

223-
* `%s` - `String` will be used to convert all values except `BigInt` and
224-
`Object`. `BigInt` values will be represented with an `n` and Objects are
223+
* `%s` - `String` will be used to convert all values except `BigInt`, `Object`
224+
and `-0`. `BigInt` values will be represented with an `n` and Objects are
225225
inspected using `util.inspect()` with options
226-
`{ depth: 0, colors: false, compact: 3 }`.
227-
* `%d` - `Number` will be used to convert all values except `BigInt`.
228-
* `%i` - `parseInt(value, 10)` is used for all values except `BigInt`.
229-
* `%f` - `parseFloat(value)` is used for all values.
226+
`{ depth: 0, colors: false, compact: 3 }`.
227+
* `%d` - `Number` will be used to convert all values except `BigInt` and
228+
`Symbol`.
229+
* `%i` - `parseInt(value, 10)` is used for all values except `BigInt` and
230+
`Symbol`.
231+
* `%f` - `parseFloat(value)` is used for all values expect `Symbol`.
230232
* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument contains
231233
circular references.
232234
* `%o` - `Object`. A string representation of an object with generic JavaScript

0 commit comments

Comments
 (0)