in reply to adding st,nd,rd and th to numbers
my $num = $ARGV[0]; $num .= 'st' if (substr($num, -1) == 1); $num .= 'nd' if (substr($num, -1) == 2); $num .= 'rd' if (substr($num, -1) == 3); $num .= 'th' if (substr($num, -1) > 3); print "$num\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: adding st,nd,rd and th to numbers
by nothingmuch (Priest) on Jul 19, 2005 at 19:29 UTC | |
by zshzn (Hermit) on Jul 19, 2005 at 19:36 UTC | |
|
Re^2: adding st,nd,rd and th to numbers
by zshzn (Hermit) on Jul 19, 2005 at 19:33 UTC |