Last active
September 7, 2022 23:32
-
-
Save mCzolko/81652a0be36286f46f526f4baf8243b9 to your computer and use it in GitHub Desktop.
Revisions
-
mCzolko revised this gist
Sep 7, 2022 . 1 changed file with 8 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,14 @@ const calculate = (arg) => { const o2percentage = Number(arg) const fO2 = o2percentage / 100 const mod = (ppO2) => Number((((ppO2 / fO2) - 1) * 10).toFixed(2)) console.log(`EAN${o2percentage} (content ${o2percentage}% oxygen)`) console.table({ '': { ppO2: 1.4, m: mod(1.4) }, deco: { ppO2: 1.6, m: mod(1.6) }, }, ['ppO2', 'm']) if (process.argv.indexOf(arg) != process.argv.length - 1) { console.log('') @@ -17,4 +20,4 @@ const calculate = (arg) => { const [ runner, command, ...o2percentages ] = process.argv o2percentages.forEach(calculate) -
mCzolko revised this gist
Sep 7, 2022 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,4 @@ const calculate = (arg) => { const [ runner, command, ...o2percentages ] = process.argv o2percentages.forEach(calculate) -
mCzolko created this gist
Sep 7, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/node const calculate = (arg) => { const o2percentage = Number(arg) const fO2 = o2percentage / 100 const mod = (ppO2) => (((ppO2 / fO2) - 1) * 10).toFixed(2) console.log(`EAN${o2percentage} MOD on ppO2:`) console.log(` [1.4] ${mod(1.4)}m`) console.log(` [1.6] ${mod(1.6)}m (deco gas)`) if (process.argv.indexOf(arg) != process.argv.length - 1) { console.log('') } } const [ runner, command, ...o2percentages ] = process.argv o2percentages.forEach(o2p => { calculate(o2p) })