FormulaParser Test Steeve
var FormulaParser = require('hot-formula-parser').Parser;
var parser = new FormulaParser();
function calcul(DEPTH_FT){
parser.setVariable('DEPTH_FT', DEPTH_FT);
parser.setVariable('MAXIMUM_ALLOWABLE_TENSION_DEPTH_LB',
parser.parse("Round(3.14*(( DEPTH_FT *TAN(RADIANS(30)))^2)* DEPTH_FT /3*0.6*69,-2)").result);
console.log(
'DEPTH_FT:' + parser.parse("DEPTH_FT").result + '/ ' +
'MAXIMUM_ALLOWABLE_TENSION_DEPTH_LB:' + parser.parse("MAXIMUM_ALLOWABLE_TENSION_DEPTH_LB").result + '/ '
);
}
calcul(4);
calcul(5);
calcul(6);
calcul(7);
calcul(8);
calcul(9);
calcul(10);
calcul(11);
calcul(12);
calcul(4.25);
calcul(4.50);
calcul(4.75);
no comments