-
Notifications
You must be signed in to change notification settings - Fork 108
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
Support algorithmic (RBNF) numbering systems: native, traditio, finance #95
Comments
Useful related UTS 35 link: http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems |
On a related note, there currently seems to be no support for any numbering system classed as "algorithmic". Any chance of getting that? |
@ray007 Can you say more about your use case? |
My program is only a processor for customer projects. |
@ray007 Do you know more about what your customers will need from number formatting? |
Experience says: they'll use everything we offer and will ask for more. |
Is there any way you can ask your customers which features are important to them that are missing? So far, we've shied away from just exporting everything that's in CLDR. |
IMHO exporting everythings that's in CLDR sounds like a good idea to me. I can ask. |
I don't think we can do this in the Web context, because CLDR changes over time and we need APIs that don't break over time.
That's great. Sounds like you can just point out the missing features that are needed. If I understand, that's exactly what @littledan asked you. |
The data in the CLDR may change over time, the API to retrieve it should not.
I'll do so for
I could think of even more useful styles, but that's what we have now. I did an implementation for |
I'm using
|
Seems a valid proposal to me… Needs a champion.
Those are supported. Are you missing anything in particlar?
Please refer to #37
See #34
I understand what you say here, but in order to sell this spec addition to the comittee it's required that we provide (among others) appealing use cases. Since you miss this in Ecma, can you help to provide those use cases with rich details? For example, nothing occures me for spellout; but for algorithmic nus, you can create a list the locales that would be better supported by enabling their native nu (http://www.unicode.org/repos/cldr/trunk/common/bcp47/number.xml). Then, such proposals would also require a champion. |
Currency works, though other than the ICU API, it doesn't take the currency to use from the locale if not given. Agreed about While I'm sure some customer will ask, The algorithmic numbering systems we're sure to be missing are Style |
Ok. I think you're asking for |
@ray007 can you create issues individually for each point you said above? |
@littledan @zbraniecki, supporting algorithmic numbering systems seems a valid requirement for this issue here, because some locales have algorithmic numbering system in their "native", "traditio", or "finance" nus. The Japan example @ray007 provided has this:
Note that |
Yes - but for one difference: in the icu api, if you use locale "en_US", it automatically selects "USD" for currency. |
Let's discuss different topics in their to-be-created issues... |
Which means that for each and every addition we need to carefully spec a forward-compatible API, create a spec proposal, find a champion, move it through stages and implement in engines. That's very different from saying "IMHO exporting everythings that's in CLDR sounds like a good idea to me.", so please, be very specific when you request features, separate each feature you request in it's own issue to make it easier to discuss each one in isolation, give examples of what such feature would enable and so on. Stating that "all CLDR should be exposed" is not helpful. |
"Exposing all of CLDR" is interesting to understand as a goal. If each of these features, one by one, is motivated mostly by its presence in ICU, then that's useful in evaluating it. I'd prefer if we had more information about where programmers (for example, your customers) want to use these things, which I don't see in some of the newly filed bugs. It shouldn't be enough to write something up; it needs to be justified as well. |
I can't give any better wishes right now since I don't know what the customers will to with the new localization options we released just last week. |
any volunteer to champion this? |
Algorithmic numbering systems are useful, but additional use cases are important to prioritize this relative to other ongoing work in the ECMA-402 specification. Adding algorithmic numbering systems would add quite a bit of required complexity to the implementation side (even though ICU supports it, rule-based number formatting is a substantial bit of code that non-ICU implementors would need to start carrying). |
@sffc Here's my use-case: the Hebrew numbering system doesn't work for I see that this is began in 2016. What can I do to help move this proposal along? |
@binyamin does https://github.com/tc39/proposal-temporal solve your concerns? |
@ljharb maybe. Does it work with algorithmic numbering systems (eg. Edit: Temporal relies on Intl, which doesn't support hebrew numbering systems either. |
Thanks for the use case! Temporal provides Hebrew calendar arithmetic, but it doesn't provide the algorithmic numbering system |
FWIW, we've been working on a number input that supports localized numbers. We currently support the
whereas hanidec outputs https://twitter.com/kourge/status/1390357371642277890
After we determined that browsers don't currently support algorithmic numbering systems, I found this issue. Since a number input is typically meant for entering quantities (e.g. incrementable numbers), I think this is a good use case for supporting algorithmic numbering systems. Since I am here I'll also say that parsing support, even if advanced formatting isn't supported, would be useful. We were able to implement a parser using the data available from Intl.NumberFormat by generating a map between digits and ascii (blog post about our approach), but for algorithmic numbering systems this would be much more difficult. We'd end up reimplementing the rules defined in CLDR in JS, which would have a lot of overhead. This is probably a separate issue though. |
I'd like to add that Chinese calendars and ordinals are also use cases for algorithmic numbering. Although it's possible to use a decimal numbering system for both of these, character-based representations are just as common in the wild:
Furthermore, the agricultural lunar calendar uses a modified version of the traditional numbering system, where 20 is represented as 廿 instead of 二十. |
Is it legal per spec for an implementation to support say |
ECMA-402 currently assumes/requires that the numbering systems be in decimal because of the way it handles grouping and decimal separators. It's possible that a lighterweight proposal could be to rewrite the PartitionNotationSubPattern AO to be more relaxed about this so that algorithmic https://tc39.es/ecma402/#sec-partitionnotationsubpattern However, the implementation requirement to include RBNF would need to be discussed. I'm not sure we can get buy-in from implementers to require RBNF until everyone supports it (e.g. ICU4X), and likewise I don't know if we can get buy-in to merely allow it due to web compatibility concerns if some browsers ship it but not others. |
@sffc thanks for clarifying, even if disappointing. I will note that is not a great reason to require it, especially since grouping and decimal aren't needed for, say, date and year formatting which is a high runner use case here. the rewrite makes some sense. I'd also note that for broader implementation, it might be good for CLDR to first implement the spec change in https://unicode-org.atlassian.net/browse/CLDR-10884 |
I noticed this bug languishing in the old tracker, and I was wondering if it still needs to be addressed https://bugs.ecmascript.org/show_bug.cgi?id=692 . Any thoughts? @jshin @caridy
EDIT (2020-07-12): Since this bug involves linking Rule-Based Number Format (RBNF), the following styles should also be supported:
EDIT (2020-08-10): Spellout and ordinal are now being tracked in #494.
The text was updated successfully, but these errors were encountered: