Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor to all regexes

  • Loading branch information...
commit 3e0d7d03ea299edada5ae0d587303689f68346dc 1 parent 5d00414
@NathanNeff authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/groovy/org/bworks/bworksdb/NumberSuffix.groovy
View
4 src/groovy/org/bworks/bworksdb/NumberSuffix.groovy
@@ -7,10 +7,10 @@ class NumberSuffix {
if ( numString =~ /.*1$/ ) {
return number+"st"
}
- else if (numString[-1] == "3") {
+ else if (numString =~ /3$/) {
return number + "rd"
}
- else if (numString[-1] == "2") {
+ else if (numString =~ /2$/) {
return number + "nd"
}
else{
Please sign in to comment.
Something went wrong with that request. Please try again.