Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-07-27, 01:30 AM
Junior Member
 
Join Date: Jul 2004
Posts: 2
zutrix
Default

hi
sorry for my english
i have a small problem with the script.
im tyring to setup it in my webpage but got problem in the seccion from carpet that wen a select allot of products that goese

more than 1000 the total don,t show it good.like if i put a product like the one from psx2 for 2 quantity it,s sopoost to

give me a totaal from 1,500.000 .in the sub total it gives me 1,500.00 but i need that it show one more 0 at the end. en in

the totaal it show me 1.00.but it,s not good it,s supoost to be 1,500.000.
this is colombian pesos.i think that something have to change in the <?php printf ("%01.2f","$gt"); ?> for the total but i

don,t know wat to change
for the sub total i don,t know.
plz can you help with this.
the link to my shopping page is h*tp://gomito58.freeunixhost.com/ventaspsx-psx2/main.php

to see the script from the carpet this is the link h*tp://gomito58.freeunixhost.com/ventaspsx-psx2/carpetscript.htm

to contact me by msn messenger is wandryw@hotmail.com
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2004-07-27, 04:35 AM
Member
 
Join Date: Apr 2004
Location: Gresham, Oregon. United States
Posts: 46
CYBER_Aeon
Default

Change
<?php printf ("%01.2f","$gt"); ?>
to
<?php printf ("%01.3f","$gt"); ?>
Reply With Quote
  #3 (permalink)  
Old 2004-07-27, 12:06 PM
Junior Member
 
Join Date: Jul 2004
Posts: 2
zutrix
Default

ok the subtotal is fixt i just changed
$sub1d = number_format ($sub1d, 2); << Change to >> $sub1d = number_format ($sub1d, 3); and than it gives me the extra 0

now the total is my problem now

its still 1.00 wat it sopost to be 1,500.000

CYBER_Aeon i have do that but it yust give me a extra 0

now something ave to change in the total
the total script is
<?php printf ("%01.2f","$gt"); ?>

the hole script is this
$sub1 = $_POST["consolapsx"];
$sub2 = $_POST["consolapsx2"];
$sub3 = $_POST["controlpsxoriginal"];
$sub4 = $_POST["controlpsxsencillo"];
$sub5 = $_POST["controlpsx2original"];
$sub6 = $_POST["multitap"];
$sub7 = $_POST["memorycardpsx"];
$sub8 = $_POST["tapete"];
$sub1d = ("$sub1"*250.000);
$sub2d = ("$sub2"*750.000);
$sub3d = ("$sub3"*39.500);
$sub4d = ("$sub4"*6.500);
$sub5d = ("$sub5"*60.000);
$sub6d = ("$sub6"*30.000);
$sub7d = ("$sub7"*6.500);
$sub8d = ("$sub8"*32.500);
$sub1d = number_format ($sub1d, 3);
$sub2d = number_format ($sub2d, 3);
$sub3d = number_format ($sub3d, 3);
$sub4d = number_format ($sub4d, 3);
$sub5d = number_format ($sub5d, 3);
$sub6d = number_format ($sub6d, 3);
$sub7d = number_format ($sub7d, 3);
$sub8d = number_format ($sub8d, 3);
if ($sub1 + $sub2 + $sub3 + $sub4 + $sub5 + $sub6 + $sub7 + $sub8 == 0 ) { $cart = "<center>Bandeja de compras esta vacio";
}
else {
$gt = ("$sub1d"+"$sub2d"+"$sub3d"+"$sub4d"+"$sub5d"+"$su b6d"+"$sub7d"+"$sub8d");
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:49 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.