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

Function addNumericalSeparator

lib/internal/errors.js:883–891  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

881
882// Only use this for integers! Decimal numbers do not work with this function.
883function addNumericalSeparator(val) {
884 let res = '';
885 let i = val.length;
886 const start = val[0] === '-' ? 1 : 0;
887 for (; i >= start + 4; i -= 3) {
888 res = `_${StringPrototypeSlice(val, i - 3, i)}${res}`;
889 }
890 return `${StringPrototypeSlice(val, 0, i)}${res}`;
891}
892
893// Used to enhance the stack that will be picked up by the inspector
894const kEnhanceStackBeforeInspector = Symbol('kEnhanceStackBeforeInspector');

Callers 1

errors.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…