Reply to printf()

Your name:

Reply:


Posted by Howard on 10/13/96 11:36

Hello everyone (the PHP beginner is back),
I've begun to read the O'Reilly book "Learning PHP 5" and came across a
"rough spot". Actually, I'm just not understanding the explanation on
printf(). It gave the following example (for those of you who have the
book, it's on page 22):

$price = 5; $tax = 0.075;
printf('The dish costs $%.2f' , $price * (1 + $tax));

This prints:
The dish costs $5.38

I know how to figure out a price after tax, but I'm not sure about the
$%.2f part. If someone can shed some light on this, I would greatly
appreciate it.

Thanks everyone,
Howard

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация