@formatjs/intl-pluralrules
Version:
Polyfill for Intl.PluralRules
27 lines (26 loc) • 1.33 kB
JavaScript
/* @generated */
// prettier-ignore
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["few","many","one","other","two","zero"],"ordinal":["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));
if (isOrdinal) {
}
else {
if (((n % 100) >= 3 && (n % 100) <= 10))
return "few";
if (((n % 100) >= 11 && (n % 100) <= 99))
return "many";
if (n === 1)
return "one";
if (n === 2)
return "two";
if (n === 0)
return "zero";
}
return "other";
},"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_other":"other","many_few":"few","many_many":"many","many_other":"other","one_few":"few","one_many":"many","one_other":"other","one_two":"other","other_few":"few","other_many":"many","other_one":"other","other_other":"other","other_two":"other","two_few":"few","two_many":"many","two_other":"other","zero_few":"few","zero_many":"many","zero_one":"zero","zero_other":"other","zero_two":"zero"},"ordinal":{}}},"locale":"ar"})
}