# How to convert a number to an ordinal?

I had a look at the Number Format Codes page in the LibreOffice Help. It shows a lot of useful date conversions and I was hoping it would include converting cardinals to ordinals but I don’t see that. E.g.

1 -> 1st
2 -> 2nd
3 -> 3rd
etc...

Is there a standard way of doing this in Libre Office?

Edit: I realised that the date formats I mentioned are irrelevant in the context of my question.

Hallo

Use the new Fontfeatures of Linux Libertine G and Linux Biolinum G,

for Example:
Cellformat with Fontname Linux Libertine G:name=3
and FontLanguage: English(USA)

As I read the question, it doesn’t worry about superscript letters but only about the assignment of traditional notational letter-pairs (a problem that should never have arisen taking notations of numbers as basically different from abbreviating words; cf German).

However, the assignment can be done

a) explicitly using a concatenating formula like the below suggested one

=A10&IF(QUOTIENT(A10;10)=1;"th";CHOOSE(MIN(MOD(A10;10)+1;5);"th";"st";"nd";"rd";"th"))

b) applying a properly defined conditional format.

You may also use the named cell styles as parameters to the STYLE function.

a) will convert the value into a text containing the “ordinal notation”. b) will leave a numeric value and only apply a format.

1 Like

Never had thought of this again, and nobody crtitisized the above formula for more than 7 years.
Now somebody had a close look at the topic again, and made me aware of a serious flaw (via PM).
An enhancemenrt of the formula avoiding that flaw (and an additional one) would be:
=IF(OR(A1="";A1<0;A1<>INT(A1));":no:ordinal:";A1&IF(QUOTIENT(MOD(A1;100);10)=1;"th";CHOOSE(MIN(MOD(A1;10)+1;5);"th";"st";"nd";"rd";"th")))