Small ordinals?
-
Hello The following produces a date in this ordinal format: 30th October 2014:
Function ReturnDate() As String
Dim theDate As String = "" Dim NumericDayofMonth As Integer = Date.Now.Day Dim OrdinalSuffix As String = "" Select Case NumericDayofMonth Case 1, 21, 31 OrdinalSuffix = "st" Case 2, 22 OrdinalSuffix = "nd" Case 3, 23 OrdinalSuffix = "rd" Case Else OrdinalSuffix = "th" End Select Dim NumericMonthofYear As Integer = Date.Now.Month Dim MonthofYear As String = "" Select Case NumericMonthofYear Case 1 MonthofYear = "January" Case 2 MonthofYear = "February" Case 3 MonthofYear = "March" Case 4 MonthofYear = "April" Case 5 MonthofYear = "May" Case 6 MonthofYear = "June" Case 7 MonthofYear = "July" Case 8 MonthofYear = "August" Case 9 MonthofYear = "September" Case 10 MonthofYear = "October" Case 11 MonthofYear = "November" Case 12 MonthofYear = "December" End Select 'Dim NumericDayofWeek As Integer = Date.Now.DayOfWeek 'Dim DayofWeek As String = "" 'Select Case NumericDayofWeek ' Case 1 ' DayofWeek = "Monday" ' Case 2 ' DayofWeek = "Tuesday" ' Case 3 ' DayofWeek = "Wednesday" ' Case 4 ' DayofWeek = "Thursday" ' Case 5 ' DayofWeek = "Friday" ' Case 6 ' DayofWeek = "Saturday" ' Case 7 ' DayofWeek = "Sunday" 'End Select 'theDate &= DayofWeek & " " 'Monday, Tuesday, Wednesday etc theDate &= DateTime.Now.Day.ToString() '1, 2, 3, 4 etc theDate &= OrdinalSuffix & " " 'st, nd, rd, th theDate &= MonthofYear & " " 'Jan, Feb etc theDate &= DateTime.Now.Year.ToString() '2013, 2014 etc Return theDate End Function
and then, in a sub page_load:
LblDate.Text = ReturnDate()
But how would I make the 'st', 'nd', 'rd
-
Hello The following produces a date in this ordinal format: 30th October 2014:
Function ReturnDate() As String
Dim theDate As String = "" Dim NumericDayofMonth As Integer = Date.Now.Day Dim OrdinalSuffix As String = "" Select Case NumericDayofMonth Case 1, 21, 31 OrdinalSuffix = "st" Case 2, 22 OrdinalSuffix = "nd" Case 3, 23 OrdinalSuffix = "rd" Case Else OrdinalSuffix = "th" End Select Dim NumericMonthofYear As Integer = Date.Now.Month Dim MonthofYear As String = "" Select Case NumericMonthofYear Case 1 MonthofYear = "January" Case 2 MonthofYear = "February" Case 3 MonthofYear = "March" Case 4 MonthofYear = "April" Case 5 MonthofYear = "May" Case 6 MonthofYear = "June" Case 7 MonthofYear = "July" Case 8 MonthofYear = "August" Case 9 MonthofYear = "September" Case 10 MonthofYear = "October" Case 11 MonthofYear = "November" Case 12 MonthofYear = "December" End Select 'Dim NumericDayofWeek As Integer = Date.Now.DayOfWeek 'Dim DayofWeek As String = "" 'Select Case NumericDayofWeek ' Case 1 ' DayofWeek = "Monday" ' Case 2 ' DayofWeek = "Tuesday" ' Case 3 ' DayofWeek = "Wednesday" ' Case 4 ' DayofWeek = "Thursday" ' Case 5 ' DayofWeek = "Friday" ' Case 6 ' DayofWeek = "Saturday" ' Case 7 ' DayofWeek = "Sunday" 'End Select 'theDate &= DayofWeek & " " 'Monday, Tuesday, Wednesday etc theDate &= DateTime.Now.Day.ToString() '1, 2, 3, 4 etc theDate &= OrdinalSuffix & " " 'st, nd, rd, th theDate &= MonthofYear & " " 'Jan, Feb etc theDate &= DateTime.Now.Year.ToString() '2013, 2014 etc Return theDate End Function
and then, in a sub page_load:
LblDate.Text = ReturnDate()
But how would I make the 'st', 'nd', 'rd
-
Have you tried
OrdinalSuffix = "st"
I don't know what raised means, but you can use span, an inline element to adjust how it looks http://webdesign.about.com/od/fonts/a/aa082400a.htm[^]
That's great, jkirkerx. It looks like this now: http://www.bayingwolf.com/Ordinal.jpg[^] Raised means like this: http://www.bayingwolf.com/Raised.jpg[^] Thank you!
-
That's great, jkirkerx. It looks like this now: http://www.bayingwolf.com/Ordinal.jpg[^] Raised means like this: http://www.bayingwolf.com/Raised.jpg[^] Thank you!
-
Hello The following produces a date in this ordinal format: 30th October 2014:
Function ReturnDate() As String
Dim theDate As String = "" Dim NumericDayofMonth As Integer = Date.Now.Day Dim OrdinalSuffix As String = "" Select Case NumericDayofMonth Case 1, 21, 31 OrdinalSuffix = "st" Case 2, 22 OrdinalSuffix = "nd" Case 3, 23 OrdinalSuffix = "rd" Case Else OrdinalSuffix = "th" End Select Dim NumericMonthofYear As Integer = Date.Now.Month Dim MonthofYear As String = "" Select Case NumericMonthofYear Case 1 MonthofYear = "January" Case 2 MonthofYear = "February" Case 3 MonthofYear = "March" Case 4 MonthofYear = "April" Case 5 MonthofYear = "May" Case 6 MonthofYear = "June" Case 7 MonthofYear = "July" Case 8 MonthofYear = "August" Case 9 MonthofYear = "September" Case 10 MonthofYear = "October" Case 11 MonthofYear = "November" Case 12 MonthofYear = "December" End Select 'Dim NumericDayofWeek As Integer = Date.Now.DayOfWeek 'Dim DayofWeek As String = "" 'Select Case NumericDayofWeek ' Case 1 ' DayofWeek = "Monday" ' Case 2 ' DayofWeek = "Tuesday" ' Case 3 ' DayofWeek = "Wednesday" ' Case 4 ' DayofWeek = "Thursday" ' Case 5 ' DayofWeek = "Friday" ' Case 6 ' DayofWeek = "Saturday" ' Case 7 ' DayofWeek = "Sunday" 'End Select 'theDate &= DayofWeek & " " 'Monday, Tuesday, Wednesday etc theDate &= DateTime.Now.Day.ToString() '1, 2, 3, 4 etc theDate &= OrdinalSuffix & " " 'st, nd, rd, th theDate &= MonthofYear & " " 'Jan, Feb etc theDate &= DateTime.Now.Year.ToString() '2013, 2014 etc Return theDate End Function
and then, in a sub page_load:
LblDate.Text = ReturnDate()
But how would I make the 'st', 'nd', 'rd
It sounds like you're looking for the
<sup>
(superscript) element:30<sup>th</sup> October 2014
30th October 2014 There's also a
<sub>
(subscript) element:H<sub>2</sub>O
H2O
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
It sounds like you're looking for the
<sup>
(superscript) element:30<sup>th</sup> October 2014
30th October 2014 There's also a
<sub>
(subscript) element:H<sub>2</sub>O
H2O
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
[^] Wonderful stuff!! Thank you again!
-
That's great, jkirkerx. It looks like this now: http://www.bayingwolf.com/Ordinal.jpg[^] Raised means like this: http://www.bayingwolf.com/Raised.jpg[^] Thank you!
Nice to see the link that you have provided.
~R@JEES#