Skip to content

Conversation

@eemeli
Copy link
Owner

@eemeli eemeli commented Dec 28, 2025

In some Romance language, compact representations of millions use the many category rather than other. Supporting this requires adding another input argument:

export const fr = (n, c) => {
  const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
  return n >= 0 && n < 2 ? 'one'
    : !c && i != 0 && i1000000 == 0 && v0 || c > 5 ? 'many'
    : 'other';
};

@eemeli eemeli merged commit d5c283b into main Dec 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants