-
DescriptionI would like to to format all numbers in my Quarto document using a comma thousands separator. For example, inline code that evaluates to Currently, I need to wrap each number in a function to apply the formatting, e.g. Ideally, I would like a document-level YAML option such as Is there such an option that I'm not finding in the documentation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Dear @maia-sh, Because you are using
at the begin of your documents as mentioned at https://stackoverflow.com/a/18967590/1802726. |
Beta Was this translation helpful? Give feedback.
-
Indeed, this is something do be done within the language you are using or write a Lua filter that parses strings to detect number and rewrite/format them. |
Beta Was this translation helpful? Give feedback.
Many thanks, @rgaiacs! I wasn't familiar with knitr hooks. This solution works, however, sweeps up non-numeric variables, i.e, dates.
Based on your suggestion as well as a stackoverflow discussion on formatting all dates, I added to the top of my Quarto document:
This prints
1,500
and16 August 2023
.