Summary
This formula will convert a number to a text value with an ordinal suffix (1st, 2nd, 3rd… 100th)
Example
Inputs
Number | 22 |
Code
Set(
varSolution,
With(
{
varNumber: Text(TextInput_1.Text),
varSuffix: Table(
{
val: "th",
key: "11"
},
{
val: "th",
key: "12"
},
{
val: "th",
key: "13"
},
{
val: "st",
key: "1"
},
{
val: "nd",
key: "2"
},
{
val: "rd",
key: "3"
}
)
},
Concatenate(
Text(varNumber),
Coalesce(
LookUp(varSuffix, key=Right(varNumber,2), val),
LookUp(varSuffix, key=Right(varNumber,1), val),
"th"
)
)
)
)
Result
22nd |