Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/hooks/useNumberInput/utils/fixedDecimalValue.ts
function fixedDecimalValue(value, decimalSeparator, fixedDecimalLength) {
	if (decimalSeparator.length !== 1) throw new Error("decimalSeparator must be a single character.");
	const decimalIndex = value.indexOf(decimalSeparator);
	if (fixedDecimalLength === void 0) return value;
	if (decimalIndex === -1) return `${value}${decimalSeparator}${"0".repeat(fixedDecimalLength)}`;
	const integerPart = value.substring(0, decimalIndex);
	let decimalPart = value.substring(decimalIndex + 1);
	if (decimalPart === "") {
		decimalPart = "0".repeat(fixedDecimalLength);
		return `${integerPart}${decimalSeparator}${decimalPart}`;
	}
	const currentDecimalLength = decimalPart.length;
	if (currentDecimalLength < fixedDecimalLength) {
		const paddingLength = fixedDecimalLength - currentDecimalLength;
		return `${integerPart}${decimalSeparator}${decimalPart + "0".repeat(paddingLength)}`;
	} else if (currentDecimalLength > fixedDecimalLength) return `${integerPart}${decimalSeparator}${decimalPart.substring(0, fixedDecimalLength)}`;
	else return value;
}
//#endregion
exports.fixedDecimalValue = fixedDecimalValue;
