Answers for "percentatge difference between two numbers javascript"

0

percentatge difference between two numbers javascript

function relDiff(a, b) {
 return  100 * Math.abs( ( a - b ) / ( (a+b)/2 ) );
}
// example
relDiff(11240, 11192); //=> 0.42796005706134094
Posted by: Guest on November-11-2020

Code answers related to "percentatge difference between two numbers javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language