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?
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,
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).
I am having trouble with the global styling setting. I have it set as our default and I have a template, where I am still getting twenty-four instead of 24. It’s file #1009058 (which is a binder, but I have the same setting in the underlying document which is file #1008953). Could you check it out and let me know if we are experiencing a bug or if I am making an error in my binder construction?
As explained on the Help page, there is a “cascading” system of styles, where the styling at the level of an individual document/binder takes precedence over the setting at the user’s level, which takes precedence over the setting at the customer’s level.
When creating a temporary dummy article in your Binder, it does seem to work correctly (in the sense that it’s reflecting “Letters if 0-9, else digits”):
I understand what you are saying conceptually, but it still does not seem to be working. I went into the styles and created a new Locale syle and assigned that to our base user and advanced user groups. However, when I log into the Q&A for my template, I am still getting this output.