import { useMemo as n } from "react";
import { getValueByPath as l, parseNumberFromValue as m } from "../utils/formatUtils.js";
const i = (u, o, a = {}) => {
  const { locale: s = "en-GB" } = a;
  return n(() => {
    const r = u.map((e) => {
      const t = l(e, o);
      return m(t, s);
    }).filter((e) => !Number.isNaN(e) && e !== 0);
    return r.length === 0 ? 0 : r.reduce((e, t) => e + t, 0) / r.length;
  }, [u, o, s]);
};
export {
  i as default
};
//# sourceMappingURL=useAverage.js.map
