convertToFixed = (data, fractionDigits = 2) => {
  if (["string", "number"].includes(typeof data)) {
    const n = Number(data);

    return Number.isNaN(n) ? data : Number.isInteger(n) ? n : +n.toFixed(fractionDigits);
  }
  if (Array.isArray(data)) {
    return data.map((n) => convertToFixed(n, fractionDigits));
  }
  if (typeof data === "object") {
    const result = {};

    for (const key in data) {
      result[key] = convertToFixed(data[key], fractionDigits);
    }
    return result;
  }
  return data;
}
Float numbers can't be compared strictly, so convert any numbers or structures with numbers
to same structures but with rounded numbers (int for ints, fixed(2) for floats)
@param {*} data