@formatjs/intl-pluralrules
Version:
Polyfill for Intl.PluralRules
26 lines (25 loc) • 1.41 kB
JavaScript
/* @generated */
// prettier-ignore
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","many","one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
const numStr = String(num);
const parts = numStr.split(".");
const integerPart = parts[0];
const decimalPart = parts[1] || "";
const n = Math.abs(parseFloat(numStr));
const i = Math.floor(Math.abs(parseFloat(integerPart)));
if (isOrdinal) {
if (((i % 10) === 3 || (i % 10) === 4) || (((((((((i % 1000) === 100 || (i % 1000) === 200) || (i % 1000) === 300) || (i % 1000) === 400) || (i % 1000) === 500) || (i % 1000) === 600) || (i % 1000) === 700) || (i % 1000) === 800) || (i % 1000) === 900))
return "few";
if (i === 0 || (i % 10) === 6 || (((i % 100) === 40 || (i % 100) === 60) || (i % 100) === 90))
return "many";
if ((((((i % 10) === 1 || (i % 10) === 2) || (i % 10) === 5) || (i % 10) === 7) || (i % 10) === 8) || ((((i % 100) === 20 || (i % 100) === 50) || (i % 100) === 70) || (i % 100) === 80))
return "one";
}
else {
if (n === 1)
return "one";
}
return "other";
},"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"az"})
}