/**
 * Русское склонение по числу: 1 лид / 2 лида / 5 лидов (one / few / many).
 * Правило стандартное (mod 10 / mod 100).
 */
export function pluralRu(n: number, one: string, few: string, many: string): string {
    const abs = Math.abs(n);
    const m10 = abs % 10;
    const m100 = abs % 100;
    if (m10 === 1 && m100 !== 11) return one;
    if (m10 >= 2 && m10 <= 4 && (m100 < 12 || m100 > 14)) return few;
    return many;
}

export const leadsWord = (n: number): string => pluralRu(n, 'лид', 'лида', 'лидов');
export const daysWord = (n: number): string => pluralRu(n, 'день', 'дня', 'дней');
