Re: Calculating a total

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 36187
interpreted = N
texte = I've rethought this:and come up with a workable solution:[Text]NewSubTotal=[math]total=[lineitems] [math]([quantity]*[price])* [ShowIf [Math]([weeks]/4)*[quantity][/math]<3]0.95[/ShowIf] [ShowIf [Math]([weeks]/4)*[quantity][/math]=3]0.9[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=4]0.9[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=5]0.9[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=6]0.85[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=7]0.85[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=8]0.85[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=9]0.8[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=10]0.8[/Showif] [ShowIf [Math]([weeks]/4)*[quantity][/math]=11]0.8[/Showif] [SHOWIF [Math]([weeks]/4)*[quantity][/math]>11]0.75[/Showif] [/math] +[/lineitems]0[/math][/Text] -- Stuart TremainDigital Imaging Division The Ad-Libitum Group 48 Victoria Street North Sydney 2060 Australia Phone: +612 9959 5633 Fax: +612 9929 4146email: stuartt@adlib.com.au http://www.adlib.com.auOn Wednesday, 16 August 2000, Stuart Tremain wrote: >This is where I am up to: > >This calculates the value of the price > >[Text]TextB[lineindex]=[format .2f][math]([quantity]*[price])* >[ShowIf [Math]([weeks]/4)*[quantity][/math]<3]0.95[/ShowIf] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=3]0.9[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=4]0.9[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=5]0.9[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=6]0.85[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=7]0.85[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=8]0.85[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=9]0.8[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=10]0.8[/Showif] >[ShowIf [Math]([weeks]/4)*[quantity][/math]=11]0.8[/Showif] >[SHOWIF [Math]([weeks]/4)*[quantity][/math]>11] 0.75[/Showif] >[/math][/format][/Text] > >Now what can I do to make this work properly: ie make the >integer to TextB.. dynamic > >[Math][TextB1]+[TextB2]+[TextB3]+.........etc[/Math] > > > > > > > > > > > > > > > > > > > > > >-- >Stuart Tremain > >Digital Imaging Division >The Ad-Libitum Group >48 Victoria Street >North Sydney 2060 Australia >Phone: +612 9959 5633 Fax: +612 9929 4146 > >email: stuartt@adlib.com.au >http://www.adlib.com.au > >On Wednesday, 16 August 2000, Stuart Tremain wrote: >>My shopping cart contains items whose prices have been >>calculated according to how long the product's life is. >> >>My question is, how can I add these calculated prices to give a total? >>I thought of giving them a value but I'm not sure how to gather >>the values together to calculate a total. >> >>All ideas appreciated >>-- >>Stuart Tremain >> >>Digital Imaging Division >>The Ad-Libitum Group >>48 Victoria Street >>North Sydney 2060 Australia >>Phone: +612 9959 5633 Fax: +612 9929 4146 >> >>email: stuartt@adlib.com.au >>http://www.adlib.com.au >> >> >> >>------------------------------------------------------------- >>This message is sent to you because you are subscribed to >> the mailing list . >>To unsubscribe, E-mail to: >>To switch to the DIGEST mode, E-mail to >>Web Archive of this list is at: http://search.smithmicro.com/ >> > > > >------------------------------------------------------------- >This message is sent to you because you are subscribed to > the mailing list . >To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://search.smithmicro.com/ >------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Calculating a total (Stuart Tremain 2000)
  2. Re: Calculating a total (Rob Marquardt 2000)
  3. Re: Calculating a total (John Peacock 2000)
  4. Re: Calculating a total (Stuart Tremain 2000)
  5. Re: Calculating a total (Stuart Tremain 2000)
  6. Calculating a total (Stuart Tremain 2000)
I've rethought this:and come up with a workable solution:[text]NewSubTotal=[math]total=[lineitems] [math]([quantity]*[price])* [ShowIf [math]([weeks]/4)*[quantity][/math]<3]0.95[/ShowIf] [ShowIf [math]([weeks]/4)*[quantity][/math]=3]0.9[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=4]0.9[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=5]0.9[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=6]0.85[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=7]0.85[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=8]0.85[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=9]0.8[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=10]0.8[/Showif] [ShowIf [math]([weeks]/4)*[quantity][/math]=11]0.8[/Showif] [SHOWIF [math]([weeks]/4)*[quantity][/math]>11]0.75[/Showif] [/math] +[/lineitems]0[/math][/Text] -- Stuart TremainDigital Imaging Division The Ad-Libitum Group 48 Victoria Street North Sydney 2060 Australia Phone: +612 9959 5633 Fax: +612 9929 4146email: stuartt@adlib.com.au http://www.adlib.com.auOn Wednesday, 16 August 2000, Stuart Tremain wrote: >This is where I am up to: > >This calculates the value of the price > >[text]TextB[lineindex]=[format .2f][math]([quantity]*[price])* >[ShowIf [math]([weeks]/4)*[quantity][/math]<3]0.95[/ShowIf] >[ShowIf [math]([weeks]/4)*[quantity][/math]=3]0.9[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=4]0.9[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=5]0.9[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=6]0.85[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=7]0.85[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=8]0.85[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=9]0.8[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=10]0.8[/Showif] >[ShowIf [math]([weeks]/4)*[quantity][/math]=11]0.8[/Showif] >[SHOWIF [math]([weeks]/4)*[quantity][/math]>11] 0.75[/Showif] >[/math][/format][/Text] > >Now what can I do to make this work properly: ie make the >integer to TextB.. dynamic > >[math][TextB1]+[TextB2]+[TextB3]+.........etc[/Math] > > > > > > > > > > > > > > > > > > > > > >-- >Stuart Tremain > >Digital Imaging Division >The Ad-Libitum Group >48 Victoria Street >North Sydney 2060 Australia >Phone: +612 9959 5633 Fax: +612 9929 4146 > >email: stuartt@adlib.com.au >http://www.adlib.com.au > >On Wednesday, 16 August 2000, Stuart Tremain wrote: >>My shopping cart contains items whose prices have been >>calculated according to how long the product's life is. >> >>My question is, how can I add these calculated prices to give a total? >>I thought of giving them a value but I'm not sure how to gather >>the values together to calculate a total. >> >>All ideas appreciated >>-- >>Stuart Tremain >> >>Digital Imaging Division >>The Ad-Libitum Group >>48 Victoria Street >>North Sydney 2060 Australia >>Phone: +612 9959 5633 Fax: +612 9929 4146 >> >>email: stuartt@adlib.com.au >>http://www.adlib.com.au >> >> >> >>------------------------------------------------------------- >>This message is sent to you because you are subscribed to >> the mailing list . >>To unsubscribe, E-mail to: >>To switch to the DIGEST mode, E-mail to >>Web Archive of this list is at: http://search.smithmicro.com/ >> > > > >------------------------------------------------------------- >This message is sent to you because you are subscribed to > the mailing list . >To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://search.smithmicro.com/ >------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Stuart Tremain

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WCS Newbie question (1997) Runtime version ... (2003) WebCat2: Items xx to xx shown, etc. (1997) [OT] Help Webcat 213 win (2000) Bug? (1997) Sku numbers (1997) [WebDNA] Error 500 with SUMM=T (2017) Emailer and Lack of Code Commenting (1999) syntax question, not in online refernce (1997) [ShowNext] feature in 2.0 (1997) Tip: upgrading to WebCatalog 3.x, fields to watch for (1999) Emailed problem (2000) HELP WITH DATES (1997) Inventory Adjustment (2000) syntax question, not in online refernce (1997) Country & Ship-to address & other fields ? (1997) Protect vs Authenicate (1997) textarea data entry and display (2000) Problems appending to database (1997) Occasional crashes with $remove (1997)