diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
commit | a82b6c772089aa46e30c6c89ef48f514294df3cb (patch) | |
tree | e25d9b6fd1fefe8b6ac293a5c0b53293872a8f54 /doc/ref/text/numbers.texi | |
parent | Add basic documentation for lens. (diff) | |
parent | Even more documentation. (diff) | |
download | calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.gz calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.xz |
Merge branch 'next' into datarewrite-structures
Diffstat (limited to 'doc/ref/text/numbers.texi')
-rw-r--r-- | doc/ref/text/numbers.texi | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/ref/text/numbers.texi b/doc/ref/text/numbers.texi new file mode 100644 index 00000000..fce5c9fa --- /dev/null +++ b/doc/ref/text/numbers.texi @@ -0,0 +1,42 @@ +@node Spelled out Numbers +@section Spelled out Numbers + +Numbers writtens as word. The usual interface is through +@code{(text numbers)} which uses the current locale for translations. +However, @code{(text numbers @var{<lang-code>})} can also be imported +directly with the exact same interface. Language codes should be two +letter ISO language codes (e.g. ``se'', ``en'', ...) + +When resolving the current language, first the environment variable +@env{LC_MESSAGES} is checked, followed by @env{LC_ALL}, and finaly +falls back to ``en''. + +English is also chosen if no implementation for the chosen language +exists. + +Note that English uses the term cardinal and ordinal @emph{numeral}, +rather than @emph{number}. + + +@defun number->string-ordinal n [language=(resolve-language)] +Convert a string into an ordinal number. These are the ``ranking'' +numbers, e.g. ``first'', ``second'', ... +@end defun + +@defun number->string-cardinal n [language=(resolve-language)] +Convert a string into a cardinal number. These are the ``ordinary'' +counting numbers, e.g. ``one'', ``two'', ... +@end defun + +@defun resolve-language +Return the current language. +@end defun + +@defun each-string count args ... +Return a (locale dependant) string indicating which elements of a set +are targeted, such as ``each'', ``every other'', ... + +@var{args} is reserved for locale specific extensions, such as in +Swedish where both ``var tredje'' and ``vart tredje'' (meaning ``every +third'') exists, and is chosen depending on the following noun. +@end defun |