1000단위 콤마..ㅠㅠ

1000단위 콤마..ㅠㅠ

QA

1000단위 콤마..ㅠㅠ

본문

.replace(/\B(?=(\d{3})+(?!\d))/g, ",");

위코드를 붙히면 콤마를 붙힐 수 있는 것 같긴한데,,

현재 숫자애니메이션 넣어놔서 그런가 적용이 안되네요ㅠㅠ

어떻게 적용해야할까요...ㅠㅠ

 


<script>
let count = 0;
      pointCheck();
 
      function pointCheck() {
        const qaz = window.scrollY || window.pageXOffset;
        if (
          document.getElementById("count_wrap").getBoundingClientRect().bottom <
          window.innerHeight
        ) {
          if (count >= 1) {
            return;
          }
          count++;
          var cnt0 = 31900;
 
          counterFn();
 
          function counterFn() {
            function count0Fn() {
              cnt0++;
              if (cnt0 > 31963) {
                clearInterval(id0);
              } else {
                document.getElementsByClassName("number")[0].innerHTML = cnt0;
                $(".number").text(cnt0);
              }
            }
 
            id0 = setInterval(count0Fn, 10);
          }
        } else if (
          document.getElementById("count_wrap").getBoundingClientRect().top >
          qaz
        ) {
          count = 0;
          $(".number").text(31963);
        }
      }
 
      window.onscroll = pointCheck;
 
</script>

이 질문에 댓글 쓰기 :

답변 2

답변을 작성하시기 전에 로그인 해주세요.
전체 2,655
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT