UNPKG

@formatjs/intl-pluralrules

Version:
46 lines (45 loc) 1.86 kB
/* @generated */ // prettier-ignore if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') { Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["few","one","other","two"],"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 i = Math.floor(Math.abs(parseFloat(integerPart))); const v = decimalPart.length; const f = v > 0 ? parseInt(decimalPart, 10) : 0; if (isOrdinal) { } else { if (v === 0 && ((i % 100) >= 3 && (i % 100) <= 4) || ((f % 100) >= 3 && (f % 100) <= 4)) return "few"; if (v === 0 && (i % 100) === 1 || (f % 100) === 1) return "one"; if (v === 0 && (i % 100) === 2 || (f % 100) === 2) return "two"; } return "other"; }},"locale":"hsb"}) } else { (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["few","one","other","two"],"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 i = Math.floor(Math.abs(parseFloat(integerPart))); const v = decimalPart.length; const f = v > 0 ? parseInt(decimalPart, 10) : 0; if (isOrdinal) { } else { if (v === 0 && ((i % 100) >= 3 && (i % 100) <= 4) || ((f % 100) >= 3 && (f % 100) <= 4)) return "few"; if (v === 0 && (i % 100) === 1 || (f % 100) === 1) return "one"; if (v === 0 && (i % 100) === 2 || (f % 100) === 2) return "two"; } return "other"; }},"locale":"hsb"}) }