Skip to content

Main content

Formatting: Ordinal Suffix Integer English Tool

Return only the English ordinal suffix of an exact signed decimal integer, treating the absolute ending and the 11/12/13 exception.

Loading tool…

Description

Parse the signed exact decimal integer.

English ordinal endings depend on the last digits, including the exceptional endings for eleven through thirteen. Suffix generation is a language-specific presentation rule rather than a numeric change or an interpretation of rank.

Parse the signed exact decimal integer.

When to use this tool

Use Formatting: Ordinal Suffix Integer English when you need an English ordinal suffix or its specified raised-letter display.

How to use the tool and how it works

  1. Enter integer. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Parse the signed exact decimal integer. Use its absolute last two digits for the 11-13 exception, otherwise last digit for st, nd, rd or th.1

Input fieldMeaning and unitsAccepted input
integerExact signed decimal integer string, not a floating-point value.Required. Text. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultObject containing the calculated members; expand to inspect the fields below.Required. Object.
result.suffixReturned literal suffix; inspect any lookup or placeholder flag.Calculated result member: string.
json
{
  "input": {
    "integer": "112"
  },
  "output": {
    "result": {
      "suffix": "th"
    }
  }
}

Limitations and assumptions

  • Only the English suffix is returned; the original integer is not appended. Exact integer parsing preserves large values within the accepted string budget.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a locale-aware ordinal formatter for other languages and grammatical contexts. Keep the original integer text when large-value precision or spelling must be retained.

References

  1. Calculation and input contract: format/ordinal-suffix-integer-english — tool.io

Similar or alternative tools