import index from "../../../../../../number-precision@1.5.2/node_modules/number-precision/build/index.es.js";
function toFixed(number, precision) {
  var pow = Math.pow(10, precision);
  return (Math.round(number * pow) / pow).toFixed(precision);
}
function toSafeString(number) {
  var nativeNumberStr = number.toString();
  if (Number.isNaN(+number) || !nativeNumberStr.includes("e")) {
    return nativeNumberStr;
  }
  try {
    var isNegative = number < 0;
    var absoluteValue = Math.abs(+number);
    var digitLength_1 = index.digitLength(absoluteValue);
    var integerNum = index.float2Fixed(absoluteValue);
    var integerStr_1 = integerNum.toString().replace(/e\+(\d+)/i, function(_, $1) {
      return new Array(+$1).fill(0).join("");
    });
    return (isNegative ? "-" : "") + (digitLength_1 === 0 ? integerStr_1 : integerStr_1.replace(new RegExp("\\d{1," + digitLength_1 + "}$"), function(match) {
      var decimalStr = ("" + new Array(digitLength_1).fill(0).join("") + match).slice(-digitLength_1);
      return (integerStr_1.length <= digitLength_1 ? 0 : "") + "." + decimalStr;
    }));
  } catch (e) {
  }
  return nativeNumberStr;
}
export {
  toFixed,
  toSafeString
};
//# sourceMappingURL=utils.js.map
