Add an ordinalNumber() function

This commit is contained in:
Raphaël Pinson 2015-04-27 10:00:51 +02:00
parent 9babb873c1
commit f51f152993

View File

@ -3636,6 +3636,11 @@ function fetchFromSvg(request, url, cb) {
});
}
function ordinalNumber(n) {
var s=["ᵗʰ","ˢᵗ","ⁿᵈ","ʳᵈ"], v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
function coveragePercentageColor(percentage) {
return floorCountColor(percentage, 80, 90, 100);
}