TOP TECH
  Learn How to.....
Welcome IT Related Articles Member Area  |  Sign In  |  Sign Up
.: Home :.
General
HTML
CSS
PHP
PHP-MySQL
FrontPage
Photoshop
CorelDRAW
PageMaker
MS Office
VisualBasic
All
.

.: Home :.

Home >> PHP - MySQL
PHP with example codes - 1.2 [Page 7]
Article by: Shelton Manage
Friday, 22nd May, 2009


To use Numbers

This script will use three hard-coded variables upon which calculations will be made. You'll see how these values can be dynamically determined interaction with an HTML form.

Established the requisite variables.
$quantity = 30;
$price = 119.95;
$taxrate = .05;

Performe the calculations.
$total = $quantity * $price;
$total = $total + ($total * $taxrate);

Format the total
$total = number_format ($total, 2);

Print the results.
Click to see this code:

Ex: numbers.phps | numbers.php



Page: First - 1 2 3 4 5 6 7 8 9 10 - Last

 



Comments


© 2009 Top Sri Lanka Top Tech.
Articles Manager β - Script by: DynamicCodes.com