How to add commas to numbers over one thousand in a odoo pdf report?

848 Views Asked by At

I've created a module in odoo13 that shows deposits, withdraws and balance. I want that all amount over one thousand will be separated by commas. Now the report only shows 1000, what i want is 1,000. Thank you in advance. Maybe is a simple question but iḿ a beginner in all of this.

The amount that i want to have the commas are 'amount'and 'balance'. Here's a part of my code:

<tbody>
  <t t-set = "num" t-value = "0"/>
  <t t-set = "balance" t-value = "account.initial_amount"/>
  <t t-set = "transaction" t-value = "0"/>
  <t t-foreach = "movements_list" t-as= "move">
  <tr>
    <td>
     <t t-set= "num" t-value = "num +1"/>
     <t t-esc = "num"/>
    </td>
    <td>
     <t t-esc = "move['date']"/>
    </td>
    <td class = "text-left">
      <t t-if = "move['type_operation'] == 'withdraw'">
         <span>Retiro</span>
      </t>
      <t t-else = "">
         <span>Depósito</span>
      </t>
    </td>

    <td>
    <t t-if = "move['type_operation'] == 'withdraw'">
     <t t-esc = "move['amount']"/>
     <t t-set = "transaction" t-value = "move['amount']"/>
     <t t-set = "balance" t-value = "balance - transaction"/>
    </t>
    </td>

    <td>
    <t t-if = "move['type_operation'] == 'deposit'">
    <t t-esc = "move['amount']"/>
    <t t-set = "transaction" t-value = "move['amount']"/>
    <t t-set = "balance" t-value = "balance + transaction"/>
    </t>
    </td>

    <td>
     <span t-esc = "balance"/>
    </td>
    </tr>
    </t>
    
    </tbody>

0

There are 0 best solutions below