function formatNumber(num){
const [integerPart, decimalPart] = num.toString().split('.');
const formattedIntegerPart = d3.format(integerFormat)(parseInt(integerPart, 10));
if (!decimalPart) {
return formattedIntegerPart;
}
const formattedDecimalPart = d3.format(decimalFormat)(parseFloat('0.' + decimalPart));
return `${formattedIntegerPart}${formattedDecimalPart.slice(1)}`;
}