Quantcast
Channel: Active questions tagged jekyll - Stack Overflow
Viewing all articles
Browse latest Browse all 326

Format Jekyll/Liquid number needing commas included

$
0
0

I'm trying to format numbers that are custom variables in Jekyll's Front Matter to use a comma after every third digit. Ex. 1,000,000. My number is declared in the Front Matter like this:

---my_number: 1000000---

It's then retrieved on the page like this:

{{ page.my_number }}

As expected, the output is 1000000. There's plenty of Jekyll documentation about date formatting but little to none on numeric formatting. Is there a way to format that to 1,000,0000 without the need for a Jekyll plugin?


Viewing all articles
Browse latest Browse all 326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>