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

Add Ecma 402 part of the spec #95

Closed
wants to merge 19 commits into from

Conversation

jessealama
Copy link
Collaborator

We don't currently envirion Decimal128 objects as
primitives, so we can't rely on ToPrimitive to work.

We don't currently envirion Decimal128 objects as
primitives, so we can't rely on `ToPrimitive` to work.
@jessealama jessealama requested a review from sffc January 24, 2024 13:13
Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you copy an abstract operation that already exists, it's customary to mark the parts that changed with <ins> and <del> tags - these show up in the rendering as green-background and struck-out text, respectively.

Also it might be convenient for rendering to have everything in one HTML file — if you want that, you can do <emu-import href="intl-spec.emu"></emu-import> in the main EMU file.

@jessealama
Copy link
Collaborator Author

When you copy an abstract operation that already exists, it's customary to mark the parts that changed with <ins> and <del> tags - these show up in the rendering as green-background and struck-out text, respectively.

Also it might be convenient for rendering to have everything in one HTML file — if you want that, you can do <emu-import href="intl-spec.emu"></emu-import> in the main EMU file.

This is really helpful -- thanks! I didn't know about that option.

Do you have any suggestion for how to specify the algorithm underlying the AO, given that I want to add just one step? When using ecmarkup, all sorts of warnings are generated about undefined operations. That's understandable, but since I'm not changing any of them, it would seem that I need to include all of the definitions (probably recursively going all the way back to the most primitive AOs). Is there a way of making my change without having to do that?

Copy link
Member

@littledan littledan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't there going to be a part of the Intl integration that makes NumberFormat use the Decimal's own precision (ie length of trailing zeroes) by default?

@sffc
Copy link

sffc commented Jan 25, 2024

+1, this handles the ToIntlMathematicalValue but it should preserve the Decimal's precision. The following should "just work"

new Intl.NumberFormat("en").format(new Decimal("500.00"))
// should return "500.00"

@jessealama
Copy link
Collaborator Author

I guess the task is to convert some ambient contextual information for the number of desired fractional digits (min & max) into an options bag for a call to toString. I think that can be done. We can make that example work. Where is that information available, though?

@jessealama
Copy link
Collaborator Author

I'm closing this issue for now in favor of discussing things first on an Ecma 402 call. The list of open tasks here is wide open, so a PR is premature.

@jessealama jessealama closed this Jan 31, 2024
@jessealama jessealama deleted the add-intl-spec-text branch January 31, 2024 14:37
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.

4 participants