var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g, unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
function calculateSize(n, r, i) {
	if (r === 1) return n;
	if (i ||= 100, typeof n == "number") return Math.ceil(n * r * i) / i;
	if (typeof n != "string") return n;
	let a = n.split(unitsSplit);
	if (a === null || !a.length) return n;
	let o = [], s = a.shift(), c = unitsTest.test(s);
	for (;;) {
		if (c) {
			let e = parseFloat(s);
			isNaN(e) ? o.push(s) : o.push(Math.ceil(e * r * i) / i);
		} else o.push(s);
		if (s = a.shift(), s === void 0) return o.join("");
		c = !c;
	}
}
export { calculateSize };
