Hyphenation of spelled-out English numbers
Style guides for English generally recommend hyphenating numbers in the range 21-99, for example "twenty-two", "fifty-three". Saxon traditionally uses a space rather than a hyphen in these numbers. (This affects, for example, xsl:number and format-integer).
Both conventions are encountered in practice, especially in titles such as "Chapter Twenty Two". Even if the hyphenated style is more common, it wouldn't be a good idea for Saxon to change its output for compatibility reasons.
When we incorporated ICU for numbering, we retained the existing convention for compatibility, post-processing the ICU output to remove the hyphens.
The standards allow a language code to contain "extensions" of the form "x-variant", and I propose we use "x-hyphen" (for example "en-x-hyphen" or "en-GB-x-hyphen" to request hyphenation of numbers. This should work in both xsl:number and format-integer.
Updated by Michael Kay over 3 years ago
- Status changed from New to Resolved
- Applies to branch 9.9 added
- Fix Committed on Branch 9.9 added
The goal of backwards compatibility turns out to be made more tricky by the fact that ordinal numbering is currently incompatible depending on whether ICU is used. With Saxon-HE, we currently get "twenty-third", with EE, we get "twenty third".
So I'll introduce "en-x-nohyphen" to force the use of space as separator, and if neither is specified, it continues to behave inconsistently.
I have committed the change on the 9.9 branch, and have updated the documentation on the trunk.
Please register to edit this issue