export function toChineseNumber(num) {
  let ret;
  if (num < 10) {
    ret = num.toLocaleString("zh-u-nu-hanidec");
  } else if (num === 10) {
    ret = "十";
  } else if (num > 10 && num < 20) {
    ret = "十" + (num % 10).toLocaleString("zh-u-nu-hanidec");
  } else if (num >= 20 && num < 100) {
    let s = num
      .toLocaleString("zh-u-nu-hanidec", { useGrouping: false })
      .split("");
    s.splice(1, 0, "十");
    ret = s.join("").replace("〇", "");
  } else {
    ret = num.toLocaleString("zh-u-nu-hanidec"); // 假设没有超过100的大题
  }

  return ret;
}

// 如果这台机器上登录过的学生人数小于5，那么这台电脑就是学生的
export function isThisMachineOwnByStudent() {
  return (JSON.parse(localStorage.getItem("userIds")) || []).length < 5;
}
