0

Hi currently i have code which convert a number into two decimal places in Thymleaf.

<h6 class = "font-weight-bold" 
 th:text="${#numbers.formatDecimal((purchase.itemPrice * purchase.count),1,2,'POINT')}">

I want to make this number also comma separated.How can i do that?

user3692033
  • 585
  • 3
  • 8
  • 21
  • 2
    Do you mean you want to use comma as thousand separator or as decimal separator? If thousand separator, that should work according to https://frontbackend.com/thymeleaf/thymeleaf-utility-methods-for-numbers – Wim Deblauwe Jul 09 '21 at 06:17
  • This may help you https://stackoverflow.com/questions/14160304/how-to-format-the-currency-in-html5-with-thymeleaf/48617538#48617538 – riddle_me_this Jul 10 '21 at 00:31
  • Does this answer your question? [How to format the currency in HTML5 with thymeleaf](https://stackoverflow.com/questions/14160304/how-to-format-the-currency-in-html5-with-thymeleaf) – riddle_me_this Jul 10 '21 at 00:32

0 Answers0