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";
In reply to Re: adding st,nd,rd and th to numbers
by zshzn
in thread adding st,nd,rd and th to numbers
by anniyan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |