MCPcopy Create free account
hub / github.com/PleasureTools/joyBox / MetricMult

Function MetricMult

Shared/Util.ts:12–19  ·  view source on GitHub ↗
(m: string)

Source from the content-addressed store, hash-verified

10 }
11
12 const MetricMult = (m: string): number => {
13 return Math.pow(1000, [
14 SizeToByteMetric.BYTE,
15 SizeToByteMetric.KB,
16 SizeToByteMetric.MB,
17 SizeToByteMetric.GB,
18 SizeToByteMetric.TB].findIndex(x => x === m));
19 };
20
21 return Math.ceil(size.endsWith('bit') ?
22 Number.parseFloat(size) * MetricMult(size[size.length - 4]) / 8 :

Callers 1

SizeStrToByteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected