js에 number_format()적용방법 문의
위 사이트를 제작중인데요
위 이미지의 숫자를 천자리 마다,를 넣고 싶어요
아래는 해당 html소스
<strong data-to="195943700000" name="number">0</strong>
아래는 js소스에요
"use strict";
$(".number-counters").appear(function () {
$("strong").number( true, 2 );
$(".number-counters [data-to]").each(function () {
var e = $(this).attr("data-to");
$(".number-counters").number( true, 2 );
$(this).delay(6e3).countTo({
from: 50,
to: e,
speed: 3e3,
refreshInterval: 50
})
})
});
답변 4개 / 댓글 3개
$(this).delay(6e3).countTo({
from: 50,
to: e,
speed: 3e3,
refreshInterval: 50,
formatter: function (value, options) {
return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ',');
}
});
답변을 작성하려면 로그인이 필요합니다.
