20 releases (stable)

7.0.2 Oct 19, 2022
7.0.1 Jan 5, 2021
7.0.0 May 6, 2020
6.0.0 Jan 28, 2020
0.8.2 Jul 31, 2018

#379 in Internationalization (i18n)

Download history 40038/week @ 2024-08-05 40213/week @ 2024-08-12 35785/week @ 2024-08-19 38770/week @ 2024-08-26 37711/week @ 2024-09-02 35446/week @ 2024-09-09 32219/week @ 2024-09-16 35143/week @ 2024-09-23 34509/week @ 2024-09-30 34903/week @ 2024-10-07 33973/week @ 2024-10-14 35158/week @ 2024-10-21 33952/week @ 2024-10-28 35048/week @ 2024-11-04 35389/week @ 2024-11-11 35620/week @ 2024-11-18

143,631 downloads per month
Used in 240 crates (7 directly)

Apache-2.0/MIT

110KB
3.5K SLoC

INTL Plural Rules

intl_pluralrules categorizes numbers by plural operands. See Unicode Plural Rules

crates.io Build Status Coverage Status

This library is intended to be used to find the plural category of numeric input.

Status

Currently produces operands compliant with CLDR 36 into Rust 1.31 and above.

Updating CLDR Data

If you would like to update rules.rs with plural rules that are not the specified version above (e.g. future versions of CLDR or external CLDR-compliant rules), you can regenerate the logic in rules.rs with the command:

cargo regenerate-data

You will need to replace the JSON files under /cldr_data/ with your new CLDR JSON files.

Local Development

cargo build
cargo test

When submitting a PR please use cargo fmt.

Contributors

Thank you to all contributors!

Dependencies

~0.9–1.4MB
~30K SLoC