From 91df200ad63a26e931bde44aa305081c5e30c01f Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 3 Dec 2021 15:56:43 +0100 Subject: [PATCH] util: add numericSeparator to util.inspect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the `numericSeparator` option to util.inspect. Using it separates numbers by thousands adding the underscore accordingly. Signed-off-by: Ruben Bridgewater PR-URL: https://github.com/nodejs/node/pull/41003 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: Rich Trott --- doc/api/util.md | 21 ++++++ lib/internal/util/inspect.js | 116 +++++++++++++++++++++++------ test/parallel/test-util-format.js | 31 ++++++++ test/parallel/test-util-inspect.js | 49 ++++++++++++ 4 files changed, 194 insertions(+), 23 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 3810b1145cd7cc..3b4078b6dc8a42 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -485,6 +485,9 @@ stream.write('With ES6');