diff --git a/src/main/resources/templates/auction/auction.html b/src/main/resources/templates/auction/auction.html index 608c6a7..6b30d29 100644 --- a/src/main/resources/templates/auction/auction.html +++ b/src/main/resources/templates/auction/auction.html @@ -24,6 +24,18 @@ var url = '/auction/product/' + productId; window.location.href = url; } + + // 금액에 쉼표 추가 + function formatNumber(number) { + return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + } + + // 경매 등록, 참여 내역 금액에 쉼표 추가 + window.onload = function() { + document.querySelectorAll('.price').forEach(function(element) { + element.innerText = formatNumber(element.innerText); + }); + }; @@ -31,11 +43,11 @@