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

Question: formatter with separators but without currency #154

Closed
ndberg opened this issue Oct 20, 2023 · 5 comments
Closed

Question: formatter with separators but without currency #154

ndberg opened this issue Oct 20, 2023 · 5 comments

Comments

@ndberg
Copy link

ndberg commented Oct 20, 2023

Thanks for this package.

Question, Is there a way to format a Number like this: 4’500.00 (searched, but couldn't find)

My Result should be with decimal AND thousands separator, but without currency.

If I Use ==> I get:
$money->formatByIntlLocalizedDecimal() ==> CHF 4’500.00
$money->formatByDecimal() ==> 4500.00

Or do I have to make an own formatter?

@ndberg ndberg changed the title Question: Question: formatter with separators but without currency Oct 20, 2023
@ricardogobbosouza
Copy link
Member

Hi @ndberg
Sorry for the delay

  • What type of currency are you trying to format? Ex: USD
  • Which locale?

Eg:

Money::USD(10)->format(locale: 'en')

@ndberg
Copy link
Author

ndberg commented Nov 30, 2023

Thanks @ricardogobbosouza for reaching back to me.

What I need is CHF in de_CH:

Money::CHF(10)->format(locale: 'de_CH')

@ricardogobbosouza
Copy link
Member

At the moment I recommend you create your formatter.

I'm working on a new formatter formatForHumans

@ricardogobbosouza
Copy link
Member

#155

@ndberg
Copy link
Author

ndberg commented Dec 4, 2023

Ok, thanks, formatForHumans would be great

@ndberg ndberg closed this as completed Dec 4, 2023
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