chinese-format
Convert data types to Chinese, with Rust
This crate focuses on converting data types to Chinese,
which can be achieved by implementing the ChineseFormat trait.
As a consequence, the library provides:
-
ready-made conversions for standard data types (integers, strings,
Option, pairs, ...) - but also for fairly specific types likeDigitSequence. -
Gregorian date/time, in the
gregorianmodule, in different formats viaDateBuilder,LinearTimeandDeltaTime. -
Monetary units, in the
currencymodule - at present,RenminbiCurrency(人民币). -
Dedicated numeric types - such as
Decimal,FractionandSign. -
the
ChineseVecsequence, to simplify the manipulation of arbitrary chains of logograms, as well as placeholders. -
the
Measuretrait and its related macros - especiallydefine_measure.
Features
By default, all the features in this crate are enabled:
-
digit-sequence:
-
enables conversions to Chinese for DigitSequence.
-
enables the
DecimalandIntegerParttypes.
-
-
currency: enables the whole
currencymodule for monetary conversions. -
gregorian: enables the
gregorianmodule for date/time conversions.Also enables: digit-sequence.
Crates.io
https://crates.io/crates/chinese-format
Documentation
https://docs.rs/chinese-format