MCPcopy Create free account
hub / github.com/zxlie/FeHelper / getBigNumberDisplayString

Function getBigNumberDisplayString

apps/json-format/json-utils.js:82–95  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

80}
81
82export function getBigNumberDisplayString(value) {
83 if (typeof value === 'bigint') return value.toString();
84 if (!isBigNumberLike(value)) return String(value);
85
86 if (typeof value.toString === 'function' && value.toString !== Object.prototype.toString) {
87 try {
88 const result = value.toString();
89 if (typeof result === 'string' && result !== '[object Object]') {
90 return result;
91 }
92 } catch (_) {}
93 }
94 return rebuildBigNumberFromParts(value);
95}
96
97function isInsideQuotedSegment(text, offset) {
98 let quote = '';

Callers 2

json-utils.test.jsFile · 0.90
safeStringifyFunction · 0.70

Calls 2

isBigNumberLikeFunction · 0.70

Tested by

no test coverage detected