1. 타임리프 값에 콤마(,) 넣는법

 

예시

<p th:text="'주말 가격' + ${#numbers.formatInteger(cafeDetailResponseDto.getCafeWeekendPrice(), 3, 'COMMA') + '원'}"></p>

 

금액을 123456 이라고 받아온 경우 

${#numbers.formatInteger(cafeDetailResponseDto.getCafeWeekendPrice(), 3, 'COMMA') + '원'}

를 사용하면

 

123,456원 이라는 결과를 얻을 수 있다.

 

 

2. 타임리프 값에 글자 붙이는 법

값 뒤에 + 로 연결 후 ' ' 를 사용하여 글자 삽입

+ Recent posts