function computeNumberAutoFormatCode(
	referenceValue,
	maxDisplayDecimals = 7,
	significantDigits = AUTO_FORMAT_MEDIAN_PRECISION
) {
	let formatCodeBuilder = '#,##0';

	let referenceValueLeadingDigitExponent = base10Exponent(referenceValue);
	let displayDecimals = 0;

	if (referenceValueLeadingDigitExponent - significantDigits < 0) {
		displayDecimals = Math.min(
			Math.max(Math.abs(referenceValueLeadingDigitExponent - significantDigits + 1), 0),
			maxDisplayDecimals
		);
	}

	if (displayDecimals > 0) {
		formatCodeBuilder += '.';
		formatCodeBuilder += '0'.repeat(displayDecimals);
	}

	return formatCodeBuilder;
}
@param {number} referenceValue
@returns {string} the number format code for the given reference value