export function goldCoinCalculation(goldCoins) {
        if (goldCoins === null || goldCoins === undefined) {
          return "";
        }
        if (goldCoins < 1000) {
          return String(goldCoins);
        }
        if (goldCoins >= 1000000) {
          return "1M+";
        }
        const kValue = goldCoins / 1000;
        const formattedString = kValue.toFixed(2); // 确保至少保留两位小数
        const matchResult = formattedString.match(/^\d+\.\d{0,2}/);
        if (matchResult === null) {
          return kValue.toFixed(2) + "k"; // 确保至少保留两位小数
        }
        const formatted = matchResult[0];
        return `${formatted}k`;
}