title: Convert cent value in integer to currency in HTML with thymleaf
body: <p>How to display a cent value in integer as currency in thymleaf?</p>
  
  <p>I am working on integration a bank API and the API is returning all the amounts in cents. I am using thymleaf as my templating engine and not able to display the amount correctly in the frontend. </p>
  
  <p>For example: </p>
  
  <p>The value from server = 16417<br>
  Expected output = 164.17</p>
  
  <p>I tried the following expressions but I was not able to get the expected output. </p>
  
  <p>1)</p>
  
  <p><code>&lt;span th:text="${#numbers.formatDecimal(page.amount, 0, 'COMMA', 2, 'POINT')}"&gt;&lt;/span&gt;</code></p>
  
  <p>output : <code>16,417.00</code></p>
  
  <p>2) </p>
  
  <p><code>&lt;span th:text="${#numbers.formatDecimal(page.amount/100, 0, 'COMMA', 2, 'POINT')}"&gt;&lt;/span&gt;</code></p>
  
  <p>output : <code>164.00</code></p>
  
  <p>3)</p>
  
  <p><code>&lt;span th:text="${#numbers.formatCurrency(page.amount)}"&gt;&lt;/span&gt;</code></p>
  
  <p>output: <code>$16,417.00</code></p>
  
  <p>4)</p>
  
  <p><code>&lt;span th:text="${#numbers.formatCurrency(page.amount/100)}"&gt;&lt;/span&gt;</code></p>
  
  <p>output : <code>$164.00</code></p>