MCPcopy Index your code
hub / github.com/nodejs/node / addNumericSeparator

Function addNumericSeparator

lib/internal/util/inspect.js:2165–2176  ·  view source on GitHub ↗
(integerString)

Source from the content-addressed store, hash-verified

2163}
2164
2165function addNumericSeparator(integerString) {
2166 let result = '';
2167 let i = integerString.length;
2168 assert(i !== 0);
2169 const start = integerString[0] === '-' ? 1 : 0;
2170 for (; i >= start + 4; i -= 3) {
2171 result = `_${StringPrototypeSlice(integerString, i - 3, i)}${result}`;
2172 }
2173 return i === integerString.length ?
2174 integerString :
2175 `${StringPrototypeSlice(integerString, 0, i)}${result}`;
2176}
2177
2178function addNumericSeparatorEnd(integerString) {
2179 let result = '';

Callers 2

formatNumberFunction · 0.85
formatBigIntFunction · 0.85

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…