From f5f6a5f99a81bcb9faf041f9918385a37eebb6af 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 be56a431cffa6b..d3aa6d862aa674 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -483,6 +483,9 @@ stream.write('With ES6');