daylik
2/15/2017 - 10:53 AM

func_n.js

//js
function n( num, plus, num2 ){
  if( num < 1 && num2 < 1 ){
    num = num * 10;
    num2 = num2 * 10;
  }
  var num_out = ''+num+plus+num2;
  num_out = eval(num_out);
  return num_out/10;
}

var sum = n(0.1, '+', 0.2);
console.log( sum );