-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Labels
C-numbersComponent: Numbers, units, currenciesComponent: Numbers, units, currencies
Milestone
Description
Discussion: core decimal types
- @sffc Did we want
pub type UnsignedDecimal = WithDecimal<UnsignedInteger>? Decimal is an Integer with an extra field that specifies the location of the decimal point. - @robertbastian Yes, but it is extra work.
- @sffc Is it breaking to change
pub struct UnsignedDecimaltopub type UnsignedDecimal? - @robertbastian Maybe, not sure
- @sffc If we keep
fixed_decimalas a separate non-stable crate, this is fine, because the only thing we format isDecimal - @sffc Do we want the type wrap to be private?
pub struct Decimal(Signed<UnsignedDecimal>) - @robertbastian That requires duplicating all the functions or derefing, and removing a deref step seems more semver breaking than the alternative
Proposal:
- Definitely in 2.0:
pub type Decimal = Signed<UnsignedDecimal>pub struct UnsignedDecimal
- Additional integer renames (see point 3):
pub type Integer = Signed<UnsignedInteger>pub struct UnsignedInteger
- If
fixed_decimalremains a util crate, we can do the integer changes post-2.0, which may involve a range dependency fromicu_decimaltofixed_decimal. If we merge it intoicu_decimal, we put the integer types behing an experimental feature. - If we can make
pub type UnsignedDecimalin 2.x, great, if not, fine, maybe in 3.0
LGTM: @sffc @younies @robertbastian @echeran
Metadata
Metadata
Assignees
Labels
C-numbersComponent: Numbers, units, currenciesComponent: Numbers, units, currencies