Get the App
SLTechnology News&Howtos  ›  Development  › 

How php uses NumberFormatter to format currency

Shulou Source: shulou.com Published: 2022-06-03 19:46:27 11月12日 Update

Editor to share with you how php uses NumberFormatter to format currency, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The specific implementation methods are as follows:

$amount = '12345.67 destroy formatter = new NumberFormatter (' en_GB', NumberFormatter::CURRENCY); echo'UK:'. $formatter- > formatCurrency ($amount, 'EUR'). PHP_EOL;$formatter = new NumberFormatter ('de_DE', NumberFormatter::CURRENCY); echo' DE:'. $formatter- > formatCurrency ($amount, 'EUR'). PHP_EOL; above is all the content of the article "how to use NumberFormatter to format currency in php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Articles format currency content not much most methods more knowledge industry information information channels channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB macOS Shulou Technology Microsoft