-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add support for e
oprand to PluralOperands
#228
Comments
In FixedDecimal, I would like to add an exponent field, similar to how @echeran did it in ICU4J. |
I started looking into this, because it'll block our upgrade to CLDR-38. In 38, the only use of
Can I get some help in understand what is the intended behavior here? Should we calculate |
@echeran @macchiati What is the status of "c" versus "e" for the new operand? |
Yeah, the operand It's not quite ready for general use because of a couple of issues. First, I implemented it for scientific notation as well, which means for Here are the unit tests for computing the
Rule data in CLDR have only been added for French because it's not quite ready for general use for a couple of reasons. The first reason is that I implemented the suppressed exponent computation for scientific notation as well. And it turns out that French actually treats plurals on compact numbers differently than it does plurals for scientific notation. So when we write out the plural samples, and try to parse them into a number type rich enough to support The other reason/issue on the ICU4C/J side is making sure we use a rich enough number type to hold For the implementation of plural operand As for the change of how ICU parses plural sample strings into numbers, that will cause an API change, so @macchiati and I need to draft that before proceeding on that work. |
@echeran am I correct to interpret your words and the tests that only string input (or FixedDecimal) can make If the input (in Rust) is u64, isize, or f64, it will never need PluralOperands {
n: 1000000,
i: 1000000,
v: 0,
w: 0,
f: 0,
t: 0,
e: 0
} Am I correct? In which case, the only operation |
Once the open questions are hammered out, FixedDecimal should be equipped with an |
Yep, that's right, strings/
Yes, this is an assumption we must make when implementing the function. We must clearly publicize the distinction (warning? caveat?) in the doc strings for the function so it is clear to users what tradeoffs they are making by using it.
Yes, that's right. That's all that is safe for us to infer from i64/u64. And we will probably need a
Yep! And perhaps you were already thinking about this, but if you already start with an implementation of the conversion |
In https://unicode-org.atlassian.net/browse/CLDR-12010 CLDR adds
e
operand. We should implement it as well.The text was updated successfully, but these errors were encountered: