diff --git a/index.js b/index.js index 0c69b1d..ae8d975 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ function cpuParser(input) { } const memoryMultipliers = { + m: 0.001, k: 1000, M: 1000 ** 2, G: 1000 ** 3, diff --git a/index.test.js b/index.test.js index 24ba76d..bc478b7 100644 --- a/index.test.js +++ b/index.test.js @@ -20,6 +20,7 @@ describe('a memory parser', () => { // pattern is [description, input, output] const tests = [ ['parses full numbers', '1', 1], + ['parses milli strings', '1000m', 1], ['parses kilo strings', '1k', 1 * (1000 ** 1)], ['parses Mega strings', '2M', 2 * (1000 ** 2)], ['parses Giga strings', '3G', 3 * (1000 ** 3)],