Click here to Skip to main content
11,569,100 members (63,163 online)
Click here to Skip to main content
Alternatives (1)

Tagged as

Ordinal suffixes in English for the nth degree

, 13 Jun 2011 CPOL 14.8K 5
A short C# method to put the Grammarians in a Good Humor


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

14 Jun 2011
What aboutpublic static string NUMthOF(UInt32 v){ return v.ToString() + // Append the ordinal suffix for the unit digit // unless the ten digit is a one (force 'th') "thstndrdthththththth".Substring(2 * (int)(v / 10 % 10 != 1 ? v % 10 : 0), 2);}?Now all...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
Writer, designer, inventor, musician, observer, and critic with many years of experience in each of these areas. I can do without the approval of "experts" because I believe candid statements and penetrating analysis bring greater rewards than a "pat on the back". And if I have something to say when you're not listening, I tell someone else about it.

| | Privacy | Terms of Use | Mobile
Web04 | 2.8.150624.2 | Last Updated 14 Jun 2011
Article Copyright 2011 by GAMerritt
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid