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

format number locale #21

Open
ncventure opened this issue Jan 9, 2021 · 3 comments
Open

format number locale #21

ncventure opened this issue Jan 9, 2021 · 3 comments

Comments

@ncventure
Copy link

Hi, thanks for contributing.

Wonder if we can format the numbers displayed on the invoice with the locale value?

Number("100000").toLocaleString("en-US")

@samber
Copy link
Owner

samber commented Jan 11, 2021

Looks like there is a function in PHP => https://www.php.net/manual/en/function.number-format.php

Feel free to open a PR. I'm a bit busy right now. 😭

@ncventure
Copy link
Author

@samber I see, well that's worth looking into it. However, I'm not a developer, I got this working on my machine with tutorials

@samber
Copy link
Owner

samber commented Jan 12, 2021

Oh I see.
Let me know if you have any issue. I'm pretty sure the contributing doc section can be improved.

There is no easy way to guess the invoice language.

2 choices:

  • Always use the English/International notation => 1,234.56
  • Add a param to JSON payload for a custom format

The first option seems much simpler and covers 95% of needs. What do you think?

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

No branches or pull requests

2 participants