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

Function commify

apps/code-compress/index.js:88–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87 buildCompressInfo(original, minified) {
88 let commify = str => String(str).split('').reverse().join('').replace(/(...)(?!$)/g, '$1,').split('').reverse().join('');
89 let diff = original.length - minified.length;
90 let savings = original.length ? (100 * diff / minified.length).toFixed(2) : 0;
91 this.compressInfo = '压缩前: <strong>' + commify(original.length) + '</strong>' +

Callers 1

buildCompressInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected