Convert primitive numbers to Chinese numbers, or parse Chinese numbers to primitive numbers.
This crate can convert Rust's primitive number data types to Chinese numbers as a string. For instance, 123 can be converted into 一百二十三 or 壹佰貳拾參. It supports both Traditional Chinese and Simple Chinese.
```rust extern crate chinese_number;
use chinese_number::{ChineseNumber, ChineseVariant};
asserteq!("壹佰貳拾參", 123i8.touppercasemiddle(ChineseVariant::Traditional)); asserteq!("壹佰贰拾参", 123i8.touppercasemiddle(ChineseVariant::Simple));
asserteq!("一百二十三", 123i8.tolowercase_middle(ChineseVariant::Traditional));
asserteq!("十二穰三千四百五十六秭七千八百九十垓一千二百三十四京五千六百七十八兆九千零一十二億三千四百五十六萬七千八百九十", 123456789012345678901234567890i128.tolowercasemiddle(ChineseVariant::Traditional)); asserteq!("一极二载三正四涧五沟六穰七秭八垓九京零一亿二万三千四百五十六", 1234567890123456i64.tolowercaselow(ChineseVariant::Simple));
asserteq!("一角二分", 0.12f64.tolowercase_middle(ChineseVariant::Traditional)); ```
https://crates.io/crates/chinese-number
https://docs.rs/chinese-number