Skip to content

Commit ee69e69

Browse files
author
russom
committed
A third if statement added to test numbers with ending in rd
1 parent 42025c9 commit ee69e69

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sprint-3/2-practice-tdd/get-ordinal-number.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ function getOrdinalNumber(num) {
77
if (lastDigit === 2 && lastTwoDigits !== 12) {
88
return `${num}nd`;
99
}
10-
if
10+
if (lastDigit === 3 && lastTwoDigits !== 13) {
11+
return `${num}rd`;
12+
}
1113
return `${num}th`;
1214
}
1315

0 commit comments

Comments
 (0)