Global Styling Question for numbers

I was wondering if there was a setting to get the system to globally style numbers based on the value of the number. The rule we use is that for numbers 10 and below, the number is spelled out, but for numbers above 10 you use the numerals. For example, 6 should always be six and 12 would be 12 in our documents.

Currently, I use coding that compares the data field and applies the @fullnr feature if necessary. It looks something like {#concept^datafield<10: @fullnr(#concept^datafiled)| else: #concept^datafield}. I don’t think I could use an external snippet, because #concept^datafield would vary.

Is there another solution other than using the code above in each clause that references a number?

There are actually two solutions:

  1. See Styling → Locale:

The selected option then rsults in the following:

  1. More in general, it is actually possible to use an external snippet with a datafield that constantly changes. This is what the “Parameters” is all about, see the Help site to read more about it. At first glance it appears as a fairly advanced subject, but is actly the generic solution you should have used if the Styling → Locale would not have existed.

The idea is that your external snippet does not “hard-code” a specific datafield — because that datafield is always different — but instead uses a “parameter”. That parameter can then be filled in with some different datafield every time you use the snippet.

The external snippet in question (let’s call it “NR-SNIP”, but any other name could do) would have the following content:


You can then include it in a random clause with a random datafield, as follows:


Essentially, you are telling the software to include the NR-SNIP external snippet, but to replace the ?NR parameter with the #some-random^datafield content.

By the way, it does not need to be a datafield, you could actually include anything (hardcoded number, special function, …) that would ultimately result in a number. For example,

will then result in:


Thanks this is really helpful. Is there a similar setting for ordinals? For example, if my ordinal is below 10 I want it spelled out (first instead of 1st) and if over 10 I want it in digits (13th instead of thirteenth).

@ord returns the ordinal spelled out up to 20 and in a digit-version above 20, while @short-ord always uses the digit-version.




If you want to lower this number to 10 (instead of 20), you could have an external snippet (let’s call it “ord”) that says:


and then call it as follows:

which would lead to