11 releases (6 breaking)
new 0.7.0 | May 18, 2024 |
---|---|
0.6.2 | May 18, 2024 |
0.5.0 | May 13, 2024 |
0.4.1 | May 12, 2024 |
0.1.0 | May 2, 2024 |
#48 in Internationalization (i18n)
1,176 downloads per month
160KB
2K
SLoC
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
gregorian
module, in different formats viaDateBuilder
,LinearTime
andDeltaTime
. -
Monetary units, in the
currency
module - at present,RenminbiCurrency
(人民币). -
Dedicated numeric types - such as
Decimal
,Fraction
andSign
. -
the
ChineseVec
sequence, to simplify the manipulation of arbitrary chains of logograms, as well as placeholders. -
the
Measure
trait and its related macros - especiallydefine_measure
.
Features
The crate supports the following optional features:
-
digit-sequence
:-
enables conversions to Chinese for DigitSequence.
-
enables the
Decimal
andIntegerPart
types.
-
-
currency
: enables the wholecurrency
module for monetary conversions. -
gregorian
: enables thegregorian
module for date/time conversions.Also enables:
digit-sequence
.
Crates.io
https://crates.io/crates/chinese-format
Documentation
https://docs.rs/chinese-format
License
Dependencies
~190KB