MCPcopy Index your code
hub / github.com/dmarman/sha256algorithm / ordinal

Function ordinal

src/classes/utils.js:114–127  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

112}
113
114export function ordinal(i) {
115 let j = i % 10,
116 k = i % 100;
117 if (j === 1 && k !== 11) {
118 return i + "st";
119 }
120 if (j === 2 && k !== 12) {
121 return i + "nd";
122 }
123 if (j === 3 && k !== 13) {
124 return i + "rd";
125 }
126 return i + "th";
127}

Callers 1

Explainer.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected