Format Date To 1st 2nd 3rd Vb Net

[Solved] Format Date To 1st 2nd 3rd Vb Net | Vb - Code Explorer | yomemimo.com
Question : format date to 1st 2nd 3rd vb.net

Answered by : john-michael-belmonte

private static string GetOrdinalSuffix(int num) { string number = num.ToString(); if (number.EndsWith("11")) return "th"; if (number.EndsWith("12")) return "th"; if (number.EndsWith("13")) return "th"; if (number.EndsWith("1")) return "st"; if (number.EndsWith("2")) return "nd"; if (number.EndsWith("3")) return "rd"; return "th"; }

Source : https://stackoverflow.com/questions/69262/is-there-an-easy-way-in-net-to-get-st-nd-rd-and-th-endings-for-number#69284 | Last Update : Tue, 28 Jun 22

Answers related to format date to 1st 2nd 3rd vb net

Code Explorer Popular Question For Vb