export function formatTokensZh(value) {
  const number = Number(value) || 0;
  if (number >= 100_000_000) return trimNumber(number / 100_000_000, 2) + "亿";
  if (number >= 10_000) return trimNumber(number / 10_000, 1) + "万";
  return String(Math.round(number));
}

function trimNumber(value, digits) {
  return value.toFixed(digits).replace(/\.0+$/, "").replace(/(\.\d*[1-9])0+$/, "$1");
}
