Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer and Decimal Type Renames for 2.0 #6144

Open
younies opened this issue Feb 18, 2025 · 0 comments
Open

Integer and Decimal Type Renames for 2.0 #6144

younies opened this issue Feb 18, 2025 · 0 comments
Assignees
Labels
C-numbers Component: Numbers, units, currencies

Comments

@younies
Copy link
Member

younies commented Feb 18, 2025

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 UnsignedDecimal to pub type UnsignedDecimal?
  • @robertbastian Maybe, not sure
  • @sffc If we keep fixed_decimal as a separate non-stable crate, this is fine, because the only thing we format is Decimal
  • @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:

  1. Definitely in 2.0:
    • pub type Decimal = Signed<UnsignedDecimal>
    • pub struct UnsignedDecimal
  2. Additional integer renames (see point 3):
    • pub type Integer = Signed<UnsignedInteger>
    • pub struct UnsignedInteger
  3. If fixed_decimal remains a util crate, we can do the integer changes post-2.0, which may involve a range dependency from icu_decimal to fixed_decimal. If we merge it into icu_decimal, we put the integer types behing an experimental feature.
  4. If we can make pub type UnsignedDecimal in 2.x, great, if not, fine, maybe in 3.0

LGTM: @sffc @younies @robertbastian @echeran

@younies younies self-assigned this Feb 18, 2025
@younies younies added the C-numbers Component: Numbers, units, currencies label Feb 18, 2025
Manishearth pushed a commit that referenced this issue Feb 18, 2025
# Description: 

Renames the UnsignedFixedDecimal type to UnsignedDecimal across multiple
files in the fixed_decimal module. This includes updates to:
- Rust source files
- Documentation
- Test files
- Dart bindings
- Diplomat coverage allowlist

The rename maintains the existing functionality while providing a more
concise type name.

Related Issues: #5065,
#6144


<!--
Thank you for your pull request to ICU4X!

Reminder: try to use [Conventional
Comments](https://conventionalcomments.org/) to make comments clearer.

Please see
https://github.com/unicode-org/icu4x/blob/main/CONTRIBUTING.md for
general
information on contributing to ICU4X.
-->
@sffc sffc added this to the 2.x Priority ⟨P2⟩ milestone Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-numbers Component: Numbers, units, currencies
Projects
Status: No status
Development

No branches or pull requests

2 participants