Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help (dates and lines
#11
this is an old one from fb.net forums...

Code:
Function get_number_suffix( n As Integer ) As String

  Dim suf As String

    Select Case n Mod 100
    
      Case 11 to 13
        suf = "th"

      Case Else

        Select Case n Mod 10

          Case 0
            suf = "th"
            
          Case 1
            suf = "st"
            
          Case 2
            suf = "nd"
            
          Case 3
            suf = "rd"
            
          Case Else
            suf = "th"
            
        End Select
        
    End Select

  get_number_suffix = suf
  
End Function

written by me =)
Reply
#12
Quote:not really, think of 11 to 19, they all have "th" at the end and 111 to 119 and 211 to 219...

Damn, I missed that Big Grin

Stupid awkward language :lol:
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#13
I wonder if anyone would find a use for a number to roman numeral converter...
Reply
#14
http://www.flyingsoft.phatcode.net/files...mnumer.zip
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)