1000단위 콤마..ㅠㅠ

1000단위 콤마..ㅠㅠ

QA

1000단위 콤마..ㅠㅠ

답변 2

본문

.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

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,112
© SIRSOFT
현재 페이지 제일 처음으로