Q:

Convert Decimal to Fraction

This code below converts number from decimal to fraction. I don't know if there's a better way or better methods to do this job so any advice would be appreciated.
const toFraction = (inputNumber) => {
  // Only two digits after decimal point
  inputNumber = inputNumber.toFixed(2);

  // destructure number
  let [int, dec] = inputNumber
    .toString()
    .split(".")
    .map((el) => parseInt(el));

  // Round it up to nearst multiple of 5
  dec = Math.ceil(dec / 5) * 5;

  // Keep Dividing until it's impossible
  const divide = [9, 8, 7, 6, 5, 4, 3, 2];
  let hundred = 100;
  let notOver = true;
  while (notOver) {
    notOver = false;
    for (let num of divide) {
      if (dec % num === 0 && hundred % num === 0) {
        dec /= num;
        hundred /= num;
        notOver = true;
      }
    }
  }
  return int === 0 ? `${dec}${hundred}` : `${int} ${dec}/${hundred}`;
};

A:

You can remove the toString() bit from here:
  let [int, dec] = inputNumber
    .toString()
    .split(".")
    .map((el) => parseInt(el));

toFixed returns a string. So, there is no need to call toString again.

The calculation part:
If the decimal part is 12, your output is 3/25. How do you get this? You get the greatest common divisor between 12 and 100 and divide both of them with it. GCD of 12 and 100 is 4. So, (12/4) / (100/4)
There's already a simple recursive implementation of euclidean algorithm for that:
function gcd(a, b)
    if b = 0
        return a
    else
        return gcd(b, a mod b)

You can get the precision required as an option parameter which defaults to a predefined MAX_PRECISION. Get the GCD between the dec and 10 precision (eg: 100 for precision = 2)

const MAX_PRECISION = 5

function toFraction(inputNumber, precision = MAX_PRECISION) {
  let [int, dec] = inputNumber
                      .toFixed(precision)
                      .split(".")
                      .map(n => +n)
                      
  const powerOf10 = 10 ** precision,
        gcd = getGCD(dec, powerOf10),
        fraction = `${dec/gcd}/${powerOf10/gcd}`;
  
  return int ? `${int} ${fraction}` : fraction
};

function getGCD(a, b) {
  if (!b) return a;

  return getGCD(b, a % b);
};

console.log( toFraction(1.14)   );
console.log( toFraction(5.71)   );
console.log( toFraction(3.34)   );
console.log( toFraction(5.1044) );
console.log( toFraction(0.67)   );
console.log( toFraction(0.84)   );

