import { dividePrecision } from './chunk-XGTU5ENW.mjs';
import { timesPrecision } from './chunk-5Q32IPX3.mjs';
import { isNumber } from './chunk-N7YWL7WT.mjs';

// src/numberRoundPrecision.ts
function roundPrecision(num, decimal) {
  const base = 10 ** decimal;
  let result = dividePrecision(Math.round(Math.abs(timesPrecision(num, base))), base);
  if (isNumber(num) && num < 0 && result !== 0) {
    result = timesPrecision(result, -1);
  }
  return result;
}

export { roundPrecision };
