icu4x
icu4x copied to clipboard
Develop Sign, Unsign, Nan & Inf for FixedDecimal
In many application for units (especially, mixed units), There are a need to represent the numbers as Inf, Neg, Pos ... etc.
Examples:
- 3 feet, and 11 inches --> could not be 3 feet and -11 inches
- 5:03:04 --> could not be 5:-03:+04
- Inf L/100-km
- ... etc.
Therefore, we need a way to represent Inf, Neg, Nan ... etc in FixedDecimal
Options for expressing mixed units:
- List of FixedUnsignedDecimal
- New type; FixedDecimal contains it as an inner field
- FixedDecimal gets a generic parameter
- Compositional fixed decimal types, like
Signed<T>
- List of FixedDecimal, take absolute value of each before formatting
- List of FixedDecimal, show sign when formatting:
3 feet, -11 inches