import "./index.mjs";
import { div as p, mul as a } from "./decimal.mjs";
import { isDef as e } from "./is.mjs";
function m(r, o = 0) {
  if (!e(r))
    return;
  const t = 10 ** o;
  return p(Math.round(a(r, t)), t);
}
function $(r, o = 0) {
  if (!e(r))
    return;
  const t = 10 ** o;
  return p(Math.floor(a(r, t)), t);
}
function g(r, o) {
  if (!e(r))
    return;
  let t = typeof o < "u" ? m(r, o) : r;
  const i = t < 0;
  i && (t = Math.abs(t));
  const f = String(t).split("."), h = f[0].split(""), s = f[1] || "";
  let n = "";
  return h.reverse().forEach((c, u) => {
    u !== 0 && u % 3 === 0 ? n = `${c},${n}` : n = c + n;
  }), (i ? "-" : "") + n + (s ? `.${s}` : "");
}
export {
  $ as floorWith,
  m as roundWith,
  g as toDecimalMark
};
