0

In javascript numerical values can be displayed with two significant digits using the toPrecision(2) function. Is there an equivalent in jinja2?

carl
  • 4,216
  • 9
  • 55
  • 103

1 Answers1

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?

Community
  • 1
  • 1
carl
  • 4,216
  • 9
  • 55
  • 103