How do I make amounts, correct for Euros?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do I make amounts, correct for Euros?

Post by simonmlewis »

Code: Select all

printf ("%.2f", $row->price);
echo "€";
I need this to show like this: 30,95€.
How do I make the decimal, show as a comma?

I did try:

Code: Select all

printf ("%,2f", $row->price);
echo "€";
Bit that just puts an F on the screen.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do I make amounts, correct for Euros?

Post by Celauran »

Code: Select all

echo number_format($row->price, 2, ',', ' ');
Post Reply