Crate chinese_format

Source
Expand description

This crate focuses on converting data types to Chinese, which can be achieved by implementing the ChineseFormat trait.

As a consequence, the library provides:

§Features

The crate supports the following optional features:

  • digit-sequence:

  • currency: enables the whole currency module for monetary conversions.

  • gregorian: enables the gregorian module for date/time conversions.

    Also enables: digit-sequence.

Modules§

currency
Currencies from all over the world.
gregorian
Chinese translation of the Gregorian calendar.
length
Length measures.
weight
Weight measures.

Macros§

chinese_vec
Creates ChineseVec instances with elegant simplicity.
define_count_measure
Defines a struct implementing Measure having a Count value.
define_measure
Defines a struct implementing Measure.
define_multi_register_measure
Defines a Measure having both a formal and an informal unit.
define_no_copy_measure
Like define_measure, but the generated struct is not Copy.
define_string_placeholder
Defines a new placeholder type.

Structs§

Chinese
Chinese expression.
ChineseVec
A vector containing Chinese expressions.
Count
Integer quantity expressing the result of a counting process.
Decimal
Accurate real number.
EmptyPlaceholder
Placeholder replacing an omissible value with an empty string.
Financial
Financial numbers designed to prevent falsification.
Fraction
A fraction, convertible to Chinese.
LeftPadder
Pads by adding the given logogram to the left.
LingPlaceholder
Placeholder replacing an omissible value with .
Sign
Sign of a number.
ZeroDenominator
Error for when a denominator is zero.

Enums§

Variant
The two major Chinese variants.

Traits§

ChineseFormat
Trait expressing support for infallible conversion to Chinese.
Measure
Trait describing a value combined with a unit of measurement.

Type Aliases§

CountBase
The integer type on which Count is based.
FinancialBase
The integer type on which Financial is based.
GenericResult
The most generic Error-based Result.
IntegerPart
The integer part of a Decimal.