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

Normative: Delegate to NumberFormat to handle unit formattting #122

Merged
merged 3 commits into from
Sep 1, 2022

Conversation

FrankYFTang
Copy link
Collaborator

For the case of style "short", "long" and "narrow" and resolve the
plural issue and reduce unnecessary locale data handling.

This should also resolve the issue mentioned in #118

@ryzokuken @sffc @anba @gibson042 @michaelficarra @rbuckton @rkirsling -any opinion of moving toward this direction?

@ryzokuken
Copy link
Member

@FrankYFTang thanks for this, I'd missed this simpler way of formatting the results which also avoids duplicating code as well as spec text.

@anba
Copy link
Contributor

anba commented Aug 30, 2022

Probably worth mentioning this depends on tc39/ecma402#702 resp. tc39/ecma402#704

@ryzokuken
Copy link
Member

@anba are we blocked on that right away or for Stage 4? Practically speaking, I suppose you'd need the change in order to implement this to begin with.

@anba
Copy link
Contributor

anba commented Aug 30, 2022

are we blocked on that right away or for Stage 4?

I don't know. Are there any strict guidelines which describe cases like this? It's probably okay to merge this PR, as long as there's an <emu-note> to point out that this depends on the linked ECMA-402 issues. That way we don't risk that there's any confusion for other implementers of Intl.DurationFormat who didn't read this PR.

Practically speaking, I suppose you'd need the change in order to implement this to begin with.

Implementers can work around the unit option validation checks in the Intl.NumberFormat constructor if needed. But it's easier if the ECMA-402 issue is resolved first.

@ryzokuken
Copy link
Member

@anba alright, thanks, that sounds good to me. I'll add a note and merge this.

FrankYFTang and others added 2 commits August 30, 2022 13:00
For the case of style "short", "long" and "narrow" and resolve the
plural issue and reduce unnecessary locale data handling.
@FrankYFTang
Copy link
Collaborator Author

Probably worth mentioning this depends on tc39/ecma402#702 resp. tc39/ecma402#704

Ah... I totally forgot about that dependency. Thanks for pointing that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants