With this
th:text="*{#numbers.formatCurrency(roomEntityList.get(0).price)}"
my browser will show 235.235 đ in my country.
I want it to show 235.235 instead.
How can i remove the sign 'đ'? I have already look it up but it seem theres not much we can do with formatCurrency in html
I don't see any native support for this in the documentation, but one way you can accomplish it is with regular expressions:
First,
th:withis used to create two variables:originalPriceholds the formatted currency valueonlyNumbersAndDotapplies the regular expression[^\\d.]+tooriginalPrice, which matches any unwanted characters soreplaceAllcan replace them with an empty stringThen
th:utextis then used to display the modified price, which now contains only numbers and dots.