"use client";
const x = (e, t = 4) => e ? e.length <= t * 2 ? e : `${e.slice(0, t + 2)}...${e.slice(-t)}` : "", b = (e) => new Intl.NumberFormat(e, {
  minimumFractionDigits: 0,
  maximumFractionDigits: 18,
  useGrouping: !0
});
function F({
  value: e,
  decimals: t = 2,
  locale: u = "en-US",
  showApproximateZero: m = !1
}) {
  const f = b(u), r = Number(e);
  if (r === 0 || m && Math.abs(r) < 1e-4)
    return "0";
  if (Math.abs(r) < 10 ** -t) {
    const i = r.toFixed(20), c = i.split(".")[1] || "", h = Array.from(c), n = [];
    let o = !1;
    for (const s of h)
      if (!o)
        n.push(s), s !== "0" && (o = !0);
      else if (n.length < t)
        n.push(s);
      else
        break;
    const l = i.split(".")[0], a = n.join("").replace(/0+$/, "");
    return a ? `${l}.${a}` : `${l}`;
  }
  const d = r.toFixed(t);
  return f.format(Number(Number(d).toString()));
}
export {
  F as a,
  x as s
};
//# sourceMappingURL=adjustDecimals-C6VuqYob.js.map
