bcmyers / num-format

A Rust crate for producing string representations of numbers, formatted according to international standards
Apache License 2.0
123 stars 22 forks source link

Support both - and _ as locale separators #23

Closed oberien closed 2 years ago

oberien commented 3 years ago

Currently, Locale::from_str only supports dash-delimited locales like de-DE. However, often times locales are represented with an underscore like de_DE. This PR adds support for allowing both variations to be passed to Locale::from_str.

It also updates to CLDR 39.0.0 by using the json files from https://github.com/unicode-org/cldr-json/tree/39205fdc027c935e52a268afcf01cd240f3c442d/cldr-json/cldr-numbers-full/main.

All of the diff in the num-format/ directory was autogenerated by running ./scripts/locale.sh (except for removing #![deny(deprecated)] from num-format/src/lib.rs as the deprecated mem::uninitialized is used).

bcmyers commented 2 years ago

Apologies for neglecting this for so long. I just did a bunch of maintenance on this crate, including bumping dependency versions and ripping out deprecated code. I also incorporated your changes. New version is 0.4.2 on crates.io.