/// <summary> /// this is for get postfix for numbers /// </summary> /// <param name="number"></param> /// <returns></returns> public static string ToOrdinal(int number) { switch (number % 100) { case 11: case 12: case 13: return number + "th"; } switch (number % 10) { case 1: return number + "st"; case 2: return number + "nd"; case 3: return number + "rd"; default: return number + "th"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)