const getPower = (a, b) => {
  const aLen = a.toString().split('.')[1]?.length || 0;
  const bLen = b.toString().split('.')[1]?.length || 0;
  const len = Math.max(aLen, bLen);
  return 10 ** len;
};

export const addResult = (a, b) => {
  const power = getPower(a, b);
  return ((a * power) + (b * power)) / power;
};
