Search code examples
spring-mvcspring-bootthymeleafjhipster

How to Display Currency Symbols in Thymeleaf?


I am preparing Product Quotation so I want to display Currency symbol in my Thymeleaf Template

I am using unicode value(HEX) for currency symbol from this website https://www.ip2currency.com/currency-symbol

I have written <p th:utext="${currencySymbol}"/> in my HTML page to display currency symbol but it is not working, here currencySymbol is my thymeleaf variable and it's value is &#x20b9; and I am using Spring Boot

Please Help me, How to dispay currency symbol in thymeleaf template using Unicode


Solution

  • use like this

    <span th:utext="${'&#36;'+'&nbsp;'}" ></span></b><span th:text="${p.price}"></span> it is written inside a span tag one span for currency(html of dollar) and another span tag fro dsplaying price from db