In javascript numerical values can be displayed with two significant digits using the toPrecision(2) function. Is there an equivalent in jinja2?
Asked
Active
Viewed 87 times
1 Answers
0
not sure why my question got down voted... I think its a perfectly good question... I found the answer myself, if anybody is interested
({{'%0.2f'| format(value|float)}}%)
however, this question might be a duplicate of How to use float filter to show just two digits after decimal point?