moneyphp / money

PHP implementation of Fowler's Money pattern.
http://moneyphp.org
MIT License
4.6k stars 440 forks source link

Format with thousand/million/billion/trillion suffix #652

Closed 4n70w4 closed 3 years ago

4n70w4 commented 3 years ago

Hi!

I did not find in the documentation whether such formatting can be done.

For example:

1k instead 1 000 or 1 тыс. instead 1 000 if ru_RU locale. 1.1k instead 1 100 or 1,1 тыс. instead 1 100 if ru_RU locale.

1m instead 1 000 000 or 1 млн instead 1 000 000 if ru_RU locale. 1.5m instead 1 500 000 or 1,5 млн instead 1 500 000 if ru_RU locale. ...etc

frederikbosch commented 3 years ago

@4n70w4 This is dependent on the availability of such formatting in the intl extension. See the docs on the IntlMoneyFormatter. You will have to experiment with this yourself. I cannot answer this question for every locale.