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:

Quit revisited (1997) website pro trouble (1998) WebCat2 - storing unformatted date data? (1997) RE: [BULK] [WebDNA] Can WebDNA corrupt a db? (2012) Caching [include] files ... (1997) Just Testing (1997) Test - sorry (2003) Some ThankYou page problems (1997) NT 2.1b10 (1998) Part Html part WebDNA (1997) Has anyone used WebCatalog with CGatePro? (2000) Summing a field full of numbers ... (1997) Multiple Replaces? (1997) rename a file (1997) Searching for the end (1998) Server slowing down. (1997) Tax Moratorium Expiring (2001) Scope of variables in multi include files (2000) Extended [ConvertChars] (1997) [delete] problem (1997)