function executeArithmetic(arithmeticType, input1, input2) {
  if(!isInputValid(input1)) { input1 = 0; }
  if(!isInputValid(input2)) { input2 = 0; }
  input1 = new BigNumber(input1);
  input2 = new BigNumber(input2);
  let result = null;
  switch(arithmeticType) {
    case ACTION_TYPES.ADD:
      result = input1.plus(input2);
      break;
    case ACTION_TYPES.SUBTRACT:
      result = input1.minus(input2);
      break;
    case ACTION_TYPES.MULTIPLY:
      result = input1.multipliedBy(input2);
      break;
    case ACTION_TYPES.DIVIDE:
      result = input1.dividedBy(input2);
      break;
    default:
      result = input2;
  }
  return result;
}
/**
 * Execute arithmetic with given arithmetic type & inputs,
 *  using BigNumber object to avoid the precision problem of floating point calculation.
 * @param {string} arithmeticType - Arithmetic type.
 * @param {string} input1 - 1st input.
 * @param {string} input2 - 2nd input.
 * @returns {BigNumber} Result.
 */
Execute arithmetic with given arithmetic type & inputs,
using BigNumber object to avoid the precision problem of floating point calculation.
@param {string} arithmeticType - Arithmetic type.
@param {string} input1 - 1st input.
@param {string} input2 - 2nd input.
Execute arithmetic with given arithmetic type & inputs using BigNumber object to avoid the precision problem of floating point calculation . @param { string } arithmeticType - Arithmetic type . @param { string } input1 - 1st input . @param { string } input2 - 2nd input .
function executeArithmetic(arithmeticType, input1, input2) {
  if(!isInputValid(input1)) { input1 = 0; }
  if(!isInputValid(input2)) { input2 = 0; }
  input1 = new BigNumber(input1);
  input2 = new BigNumber(input2);
  let result = null;
  switch(arithmeticType) {
    case ACTION_TYPES.ADD:
      result = input1.plus(input2);
      break;
    case ACTION_TYPES.SUBTRACT:
      result = input1.minus(input2);
      break;
    case ACTION_TYPES.MULTIPLY:
      result = input1.multipliedBy(input2);
      break;
    case ACTION_TYPES.DIVIDE:
      result = input1.dividedBy(input2);
      break;
    default:
      result = input2;
  }
  return result;
}
function executeArithmetic ( arithmeticType , input1 , input2 ) { if ( ! isInputValid ( input1 ) ) { input1 = 0 ; } if ( ! isInputValid ( input2 ) ) { input2 = 0 ; } input1 = new BigNumber ( input1 ) ; input2 = new BigNumber ( input2 ) ; let result = null ; switch ( arithmeticType ) { case ACTION_TYPES . ADD : result = input1 . plus ( input2 ) ; break ; case ACTION_TYPES . SUBTRACT : result = input1 . minus ( input2 ) ; break ; case ACTION_TYPES . MULTIPLY : result = input1 . multipliedBy ( input2 ) ; break ; case ACTION_TYPES . DIVIDE : result = input1 . dividedBy ( input2 ) ; break ; default : result = input2 ; } return result ; }
Execute arithmetic with given arithmetic type & inputs,
  using BigNumber object to avoid the precision problem of floating point calculation.
Execute arithmetic with given arithmetic type & inputs using BigNumber object to avoid the precision problem of floating point calculation .