Re: Wanted: More Math Functions (or, Can You Solve This?)

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 14042
interpreted = N
texte = >Base shipping is $4.75 cents. Every 5 pieces after the first 5 add 4.00 >to shipping. Sets count as 5 pieces. I have assigned a shipping value to >each item/set items =1 sets =5(could be more in the future)If you wanted to get real simple, you could use a shipCost of 4.75 and a unitShipCost of .80, so that 5 items would add up to 4.00 -- that would make the formulas quite straightforward.>The formula looks like this: >[math](((ceil [SV]\5)-1) x 4.00)+4.75[/math] > >where [SV] is the shipping valueI'm not sure what SV really means, and I can't tell if my formula matches yours exactly, so here are some tips:[math]ceil(1.1)[/math] yields 2'x' should be '*', and '\' should be '/' as in [math](ceil([SV]/5)-1)*4+4.75[/math]So your formulas.db would have something like name formula unitShipCost 0.00 (all calculations are done in shipCost formula instead) shipCost [math](ceil([SV]/5)-1)*4+4.75[/math]Try the math equation out first by putting it into your Invoice.tmpl page so you can see what it evaluates to. Then when you're happy with the numbers, paste the formula into your formulas.dbGrant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
  2. Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
  3. Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
  4. Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
  5. Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
  6. Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
  7. Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
  8. Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
  9. Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
  10. Re: Wanted: More Math Functions (or, Can You Solve This?) (Michael Winston 1997)
  11. Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
  12. Wanted: More Math Functions (or, Can You Solve This?) (Michael Winston 1997)
  13. Wanted: More Math Functions (or, Can You Solve This?) (Kenneth Grome 1997)
  14. Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
>Base shipping is $4.75 cents. Every 5 pieces after the first 5 add 4.00 >to shipping. Sets count as 5 pieces. I have assigned a shipping value to >each item/set items =1 sets =5(could be more in the future)If you wanted to get real simple, you could use a shipCost of 4.75 and a unitShipCost of .80, so that 5 items would add up to 4.00 -- that would make the formulas quite straightforward.>The formula looks like this: >[math](((ceil [SV]\5)-1) x 4.00)+4.75[/math] > >where [SV] is the shipping valueI'm not sure what SV really means, and I can't tell if my formula matches yours exactly, so here are some tips:[math]ceil(1.1)[/math] yields 2'x' should be '*', and '\' should be '/' as in [math](ceil([SV]/5)-1)*4+4.75[/math]So your formulas.db would have something like name formula unitShipCost 0.00 (all calculations are done in shipCost formula instead) shipCost [math](ceil([SV]/5)-1)*4+4.75[/math]Try the math equation out first by putting it into your Invoice.tmpl page so you can see what it evaluates to. Then when you're happy with the numbers, paste the formula into your formulas.dbGrant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

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:

Outsourcing & copyrights (2005) executing via commandline (2003) [fullPath] bug? (1998) WebCat2b15MacPlugin - [protect] (1997) Problems adding stuff to the shopping cart. (1997) General WebCatalog Questions (1997) Speed Test Results Dell 2650 Xeon 2.4ghz (2002) new WebDNA 5 command reference (2003) ShowNext for method=POST (1997) If Empty ? (1997) checking for [ and ] in form fields ... (1997) Fwd: Apache/Mod-SSL & WebCatalog (UNIX)! module bug? (2000) What do you charge? (1998) & not allowed in db by definition? (1999) problems with WebCat-Plugin () WebDNA Solutions ... sorry! (1997) SetHeader not Working (2006) NetSplat and WebCat2 (1997) FW: weird problem (2004) Cant open pages generated by Webcat (2004)