3

I work a lot with large numbers in tables and I would like to display the numbers this way: "1 000 000" or "1,000,000" instead of "1000000". Is there a filter that allows this with jinja or css ?

I haven't found it in the documentation or on the internet except using javascript.

gcbox999
  • 147
  • 8
  • Not AFAIK in CSS. This [link]https://stackoverflow.com/questions/8677805/formatting-numbers-decimal-places-thousands-separators-etc-with-css#:~:text=Is%20it%20possible%20to%20format%20numbers%20with%20CSS%3F,for%20other%20number%20formats%2C%20e.g.%20latin%2C%20arabic%2C%20etc. shows a JS alternative. – A Haworth Apr 07 '21 at 13:05
  • Do any of the answers [here](https://stackoverflow.com/a/31158813/14316282) help? – Rolv Apneseth Apr 07 '21 at 13:16
  • No, I am looking for a solution with a jinja filter, without javascript. – gcbox999 Apr 07 '21 at 13:18
  • check [this](https://code-maven.com/how-to-print-number-with-commas-as-thousands-separator) solution – RJ Adriaansen Apr 07 '21 at 17:53
  • I know this question is quite old, but in case you are wondering how you can do `{{ "{:,}".format(1000000) }}` where `1000000` can be your int variable. – Tes3awy Jan 18 '23 at 12:02

0 Answers0