All files / src/util ordinal.js

55.56% Statements 5/9
50% Branches 4/8
100% Functions 1/1
55.56% Lines 5/9
1 2 3 4 5 6 7 8 9 10 11 12 13  12x   12x 11x 1x 1x            
export default function ordinal(x) {
  Iif ([ 11, 12, 13 ].indexOf(x) !== -1) {
    return `${x}th`
  } else if (x % 10 === 1) {
    return `${x}st`
  } else Eif (x % 10 === 2) {
    return `${x}nd`
  } else if (x % 10 === 3) {
    return `${x}rd`
  }
  return `${x}th`
}