Page 1 of 1

Date Keywords - Auto-Texts

Posted: 09 Apr 2021 14:56
by ColinMc
On many/most of my certificates, the event date on a BMD is written as text eg twenty-fifth. In AS, this (perfectly sensibly) is normally entered as 25, and even if entered as text, is displayed subsequently as 25.

Am I correct that there is no way to get an Auto-text to revert the 25 to read twenty-fifth? I know I can use {DATE.DAY.ORD} to display the ordinal - the help-file does not list any help, but I just wanted to check that there wasn't a hidden way to do so.

I also know I can manually edit afterwards. Its not a big issue, just wanted to confirm the correct answer.

Re: Date Keywords - Auto-Texts

Posted: 09 Apr 2021 15:13
by tatewise
Have you checked the WORDNUMORD and WORDNUM functions that I think will do that.
See the AS help page for Template Keywords and Functions and scroll down to nearly the end.
It is under Ancestral Sources Reference > Options or by a Help Search for Keyword or for Function.

Re: Date Keywords - Auto-Texts

Posted: 09 Apr 2021 15:25
by ColinMc
I had looked at the help file, and found nothing.

So I'm not sure how those should be used, but I'll have a play with it now.

Re: Date Keywords - Auto-Texts

Posted: 09 Apr 2021 15:30
by ColeValleyGirl
From the Help File (towards the bottom of https://ancestral.fhug.org.uk/webhelp/h ... /hs200.htm
=WORDNUM[numeric%mode]

The WORDNUM function can be used to convert a number (between 1 and 9999) into an english version of it. The mode is a number between 1 and 6 that specifies how the returned value is displayed. It may also be useful to combine with the TITLE or TITLEF functions.

e.g. =TITLEF[=WORDNUM[{YEAR}%2]]

In the example, if the year was 1853 then the values returned would be as follows, depending on the mode:


Mode 1: Eighteen hundred and fifty-three

Mode 2:Eighteen hundred and fifty three(Same as Mode 1 without hyphens)

Mode 3: Eighteen fifty-three

Mode 4:Eighteen fifty three(Same as Mode 3 without hyphens)

Mode 5: One thousand eight hundred and fifty-three

Mode 6:One thousand eight hundred and fifty three(Same as Mode 5 without hyphens)

=WORDNUMORD[numeric%mode]

The WORDNUM function can be used to convert a number (between 1 and 9999) into an english ordinal version of it. The mode is a number between 1 and 6 that specifies how the returned value is displayed. It may also be useful to combine with the TITLE or TITLEF functions.

e.g. =TITLEF[=WORDNUMORD[{DAY}%2]]

Might display first, second, third, fourth, etc.

The mode values use the same formats as explained in the previous section describing the WORDNUM function. Modes 3 and 4 are probably not useful with ordinal values but are available to provide consistency with WORDNUM.

Re: Date Keywords - Auto-Texts

Posted: 09 Apr 2021 15:48
by ColinMc
Lovely thats a great help. Thanks to both.

Re: Date Keywords - Auto-Texts

Posted: 09 Apr 2021 18:30
by ColinMc
Works perfectly too.

Re: Date Keywords - Auto-Texts

Posted: 10 Apr 2021 13:01
by Peter Collier
Watch out for any dates that are the (2)9th of a month, it always gets misspelt as (twenty(-)) nineth rather than (twenty(-)) ninth.

Re: Date Keywords - Auto-Texts

Posted: 10 Apr 2021 17:03
by NickWalker
This will be fixed in the next version. If you had let me know when you spotted it rather than just working around it, I could have fixed it before! :roll:

Re: Date Keywords - Auto-Texts

Posted: 12 Apr 2021 14:42
by NickWalker
A new version of AS is now available (https://fhug.org.uk/kb/link/ancestral-sources/) which should spell ninth correctly!