Skip to Content
Menu
This question has been flagged
1 Reply
2551 Views

I created a Template for the Attendance Model. I used the worked_hours field:

            ${object.worked_hours}

This is displayed as a number with several decimal digits (ex,  5.498055555555555 ).


How can I modify to limit the number of decimal digits to just two?

As an alternative, can be displayed as time format (ex, 5:29)?

Avatar
Discard
Best Answer

Hello OscarCee,

you can try below code for format amount in Template

${format_amount(object.amount_total, object.currency_id)}

Thanks

Sunny Sheth
Avatar
Discard
Author

Hi Sunny,

Thanks for the answer, but that is not exactly what Im looking for. Is the same idea, but what your code will display is €5.49. but your code is from a different model (invoice) and I dont have currency in the attendance model.

I have seen the template "Invoice: Send by email" already, and that is what I think that should be a format in Odoo to display as time or limit the number of decimals in a number, but i couldnt find any information about it.

Regards,

Hi OscarCee,

which Odoo Version do you use? and community or enterprise ?

Author
I'm using Odoo Enterprise v12.3
Related Posts Replies Views Activity
1
Dec 24
54
1
Nov 24
173
0
Oct 24
2
3
Sep 24
254
1
Sep 23
3895