Very short snippet: Currency format in PHP
Wednesday, February 11, 2009 PHP provides two convenient functions to format (and print) currencies money_format() and number_format() The first can be used together with setlocale() to set the formatting according to your country, for example:
- 1234.56 ; $ number = 1234.56;
- / / USD 1,234.56
For us Europeans, and Italians, we can use:
- 1234.56 ; $ number = 1234.56;
- / / U.S. $ 1234.56
However, in the simplest cases and if you bother EUR you can use:
- 1234.56 ; $ number = 1234.56;
- / / 1234.56














Shit I'd never seen money_format for php! thanks for the tip!