Help for this page

Select Code to Download


  1. or download this
    sub num2ord {
      local $_ = shift;
    #          1        2         3         4
    # 1234567890123**789012345678901234567890
      $_.((0,st,nd,rd)[/1?.$/g]||th)
    }
    
  2. or download this
    sub num2ord {
      local $_ = shift;
    #          1         2         3
    # 123456789012345678901234567890
      $_.=(0,st,nd,rd)[/1?.$/g]||th
    }