const zhNumberFormatters = new Map<number, Intl.NumberFormat>();

export function formatZhNumber(value: number, maximumFractionDigits = 0) {
  let formatter = zhNumberFormatters.get(maximumFractionDigits);
  if (!formatter) {
    formatter = new Intl.NumberFormat('zh-CN', { maximumFractionDigits });
    zhNumberFormatters.set(maximumFractionDigits, formatter);
  }
  return formatter.format(value);
}
