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

Support for Number.prototype.toLocaleString with arguments #729

Closed
terrymun opened this issue May 5, 2020 · 7 comments
Closed

Support for Number.prototype.toLocaleString with arguments #729

terrymun opened this issue May 5, 2020 · 7 comments
Labels

Comments

@terrymun
Copy link

terrymun commented May 5, 2020

Even though Internationalization support is documented in the readme, I realized that it is not possible to provide arguments to the Number.prototype.toLocaleString method.

For example, the following examples will not work in the latest v2 release:

// Expects: 1,337.6
new Number (1337.56).toLocaleString('en-US', {
  minimumFractionDigits: 0,
  maximumFractionDigits: 1,
  useGrouping: true
});
@sebastienros
Copy link
Owner

@terrymun do you want to try and implement this?

@terrymun
Copy link
Author

terrymun commented May 5, 2020

@sebastienros I would very much love to help, but I am, unfortunately, quite unfamiliar with C# to be honest. I have created this issue because of the backend part of a project that requires JS evaluation on the server-side.

@lahma lahma added the Intl label Mar 18, 2023
@LuisMerinoP
Copy link
Contributor

LuisMerinoP commented Aug 13, 2023

Hi, I gave this a shot. I have branch for this but cannot push. Not very proud of the solution and its done with a shortcut.
Problem is that to do it the right way NumberFormat's methods need to be implemented. This is ResolveLocale and all the ones called from there which are a lot:

So tons of work to do it the right way. If I get permissions I would like to share the PR for thought sharing and possible contribution if you will. Thanks a lot. Awesome project btw!

@lahma
Copy link
Collaborator

lahma commented Aug 14, 2023

You can push to your own repository and create a pull request against this repository to demonstrate your changes. You don't need write access to PR's target repository.

@LuisMerinoP
Copy link
Contributor

thanks @lahma. Creating #1619.

@lahma
Copy link
Collaborator

lahma commented Dec 8, 2023

I'm closing this as initial version has been merged and published to NuGet, we can refine with PRs.

@lahma lahma closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants