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

Set default digital number format to minFrac=0, maxFrac=9 #144

Closed
sffc opened this issue Mar 31, 2023 · 3 comments · Fixed by #150
Closed

Set default digital number format to minFrac=0, maxFrac=9 #144

sffc opened this issue Mar 31, 2023 · 3 comments · Fixed by #150
Labels
consensus We reached a consensus in a discussion meeting, through email or the issue discussion needs-tg1 normative

Comments

@sffc
Copy link
Collaborator

sffc commented Mar 31, 2023

It's a bit late to be making changes like this, but since we keep approving them, I'll suggest another

new Intl.DurationFormat("en", { style: "digital" }).format({ seconds: 1, milliseconds: 230 });

Current output: "0:00:01"

I think the above line should display "0:00:01.23".

This can be accomplished by setting the default second format to minFrac=0, maxFrac=9.

@ryzokuken ryzokuken added normative Meeting Discussion Need to be discussed in one of the upcoming meetings labels Apr 4, 2023
@ryzokuken
Copy link
Member

I support the change of defaults but we should nonetheless discuss, especially the change of options for DurationFormat.

@sffc
Copy link
Collaborator Author

sffc commented Apr 4, 2023

Yes. There are a few options here:

  1. Keep things as spec'd.
  2. Change the default maximumFractionDigits to 9, but the fractionalDigits setter continues to work the same.
  3. Change the default maximumFractionDigits to 9, and also change the options to be [min/max]imumFractionDigits instead of fractionalDigits.
  4. Set the default fractionalDigits to undefined with the above proposed default behavior.
  5. Add "auto" as a string value to fractionalDigits and set that as the default value.

@sffc
Copy link
Collaborator Author

sffc commented Apr 7, 2023

TG2 approval: https://github.com/tc39/ecma402/blob/master/meetings/notes-2023-04-06.md#set-default-digital-number-format-to-minfrac0-maxfrac9-144

The group would like to move forward with option 4. We need an updated PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus We reached a consensus in a discussion meeting, through email or the issue discussion needs-tg1 normative
Projects
None yet
2 participants