How reduce string length in qweb?
Example:
<p t-field="doc.name" />
return stackoverflow I want remowe last 8 character and get stack
For string you can use this:
<p><t t-esc="doc.name[:-8] if doc.name else ''"/></p>
For float value try this one:
<p><t t-esc="'%.2f'%(t.amount)"/></p>
This will print value to exactly two decimal places
For "char" came from DB (just this works for me, Odoo V11)
<p><span t-if="doc.name" t-esc="str(doc.name)[:-8]"/></p>
`. If you are trying to remove the digits after the decimal point, you might want to look into [string formatting](https://pyformat.info/#number). – Naglis May 16 '17 at 10:47