One more flavor.
sub ordinal { return "$_[0]nd" if $_[0] =~ /(?<!1)2$/; return "$_[0]rd" if $_[0] =~ /(?<!1)3$/; return "$_[0]st" if $_[0] =~ /(?<!1)1$/; return "$_[0]th"; }
In reply to Re: adding st,nd,rd and th to numbers
by Your Mother
in thread adding st,nd,rd and th to numbers
by anniyan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |