Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format the number string in HTML with thymeleaf

How can I format the number string as 4digit format using thymeleaf. Eg. 5 - > 0005

like image 490
Mark Avatar asked Dec 20 '22 07:12

Mark


1 Answers

Format the string using number format. As follow :

th:text="${#numbers.formatInteger(num,5)}"
like image 195
Mark Avatar answered Dec 21 '22 19:12

Mark