import { formatDecimalParts as e } from "./formatDecimal.js";
//#region ../../node_modules/d3-format/src/formatPrefixAuto.js
var t;
function n(n, r) {
	var i = e(n, r);
	if (!i) return t = void 0, n.toPrecision(r);
	var a = i[0], o = i[1], s = o - (t = Math.max(-8, Math.min(8, Math.floor(o / 3))) * 3) + 1, c = a.length;
	return s === c ? a : s > c ? a + Array(s - c + 1).join("0") : s > 0 ? a.slice(0, s) + "." + a.slice(s) : "0." + Array(1 - s).join("0") + e(n, Math.max(0, r + s - 1))[0];
}
//#endregion
export { n as default, t as prefixExponent };
