Skip to content
Advertisement

Format decimal on definition in Admin Panel Django

I create a definition to get the percentage of completed tasks associated with a project.

JavaScript

enter image description here

I want to eliminate the decimals and transform it into whole numbers

Finally, the idea is that if all the tasks are completed, the project status should go to finished

JavaScript

Advertisement

Answer

You can round the value you obtain when retrieving the percentage:

JavaScript
Advertisement