bcdiv is only used to divide one really large number by another.  Do you
really have numbers large enough to justify using the bc library?  Why
don't you just use normal math:

<?
   $a = 5, $b = 6, $c = 9;
   $number = $a * $b * $c;
   print($number . "<br>\n");
?>

Shawn wrote:
> 
> Thanks;
> This is a great help,  One question though, I have figured out how to
> multiply 2 numbers using "bcdiv()" but how do I multiply 3 numbers?
> 
> Shawn
> 
> ----- Original Message -----
> From: "Shannon -jj Behrens" <[EMAIL PROTECTED]>
> To: "FreeTrade" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 06, 2000 10:59 AM
> Subject: Re: [FreeTrade] Modifications to item entry using PHP
> mathematicalfunctions - Need Some Advice
> 
> > > Good Morning to one and all.
> > >
> > > Maybe someone out there can help me with an idea.  Is it possible to
> have
> > > the add_item screen also do some mathematical functions in the
> background?
> >
> > I don't think you need to do it "in the background" (i.e. in a separate
> > thread or process).  You can simply do the processing in the action
> > module.
> >
> > > I would like to make a system where the admin would enter in the product
> > > information, and them based upon a numerical value for certain
> information
> > > have a price automatically generated.
> > >
> > > The information for a product would include inside dimension (height,
> width,
> > > depth), the condition of the product (new, like new, old, battered), and
> any
> > > changes made to it (retitled, original, rejacketed).  I would like to be
> > > able to have a system in place that would multiply the inside dimensions
> and
> > > come up with a total volume, then compare that with a table of values
> > > (prices) and pick the closest one.  Then take the new price and change
> it
> > > depending on the other info, if the title is rejacketed then add 10% and
> if
> > > it is in new condition add another 10% and from this generate the final
> > > price for the product.
> > >
> > > Do you think this can be done? And if it can be done, can it be
> integrated
> > > with Freetrade?
> > Sure.  Add the volume information to the add_sku page so that the admin
> > can enter it (naturally, you can get rid of the List Price and Sale
> > Price fields since the admin will no longer be using them).  Then you
> > can do some algebra such as the following (in ADD_SKU):
> >
> > function priceByVolume($volume)
> > {
> >     if ($volume < 15) return 23;
> >     if ($volume < 30) return 43;
> >     if ($volume < 45) return 56;
> >     ...
> > }
> >
> > $listPrice = priceByVolume($width*$height*$length);
> > if ($rejacketed)
> > {
> >     $listPrice *= 1.1; // add 10%
> > }
> > if ($quality == "NEW")
> > {
> >     $listPrice *= 1.5;
> > }
> >
> > I'm sure you get the idea.
> >
> > > P.S. can anyone suggest a good tutorial for using mathematical functions
> in
> > > PHP?  I have Leon's new book but it only covers the really wierd stuff
> like
> > > ARC, and TAN, and COSINE.  I only made it to 1st year geometry so that
> stuff
> > > is all greek to me.  :-)
> >
> > You probably only need some simple algebra (so far, you have not
> > mentioned anything more complicated), so you can use something like the
> > above example.
> >
> > Best Regards,
> > -jj
> >
> > --
> > if (shannon - jj) * behrens == webEngineer["CLEAR INK�"]:
> >     print "<i>imagination is the only real medium(sm)</i><br>"
> >
> >
> > ------------------------------------------------------------
> > To subscribe:    [EMAIL PROTECTED]
> > To unsubscribe:  [EMAIL PROTECTED]
> > Site:            http://www.working-dogs.com/freetrade/
> > Problems?:       [EMAIL PROTECTED]
> 
> ------------------------------------------------------------
> To subscribe:    [EMAIL PROTECTED]
> To unsubscribe:  [EMAIL PROTECTED]
> Site:            http://www.working-dogs.com/freetrade/
> Problems?:       [EMAIL PROTECTED]

-- 
if (shannon - jj) * behrens == webEngineer["CLEAR INK�"]:
    print "<i>imagination is the only real medium(sm)</i><br>"


------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to