Q:

how to casting a string to integer in html flask view

Hello everyone i want someone to help me  to convert a variable  to integer inside a loop for  , this is the item  : 
<li>the score is : {{item.score|int * 100}} %</li>

i got this :
<li>0.03618881106376648</li>

and my goal is to get the result like this
<li>3%</li>

please if anyone have a solution ! thanx

A:

Try this:
<li>the score is : {{ '{0:0.0f}'.format(item.score * 100) }}%</li>

