Related d3/d3#495. TODO:
This implementation works in English:
var suffixes = ["th", "st", "nd", "rd"];
function suffix(number) {
var tail = number % 100;
return suffixes[(tail < 11 || tail > 13) && (tail % 10)] || suffixes[0];
}
However, it’s not clear how we should localize this behavior. Perhaps the locale definition can include a JavaScript function?
Related d3/d3#495. TODO:
%o)This implementation works in English:
However, it’s not clear how we should localize this behavior. Perhaps the locale definition can include a JavaScript function?