Shipping Math

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24084
interpreted = N
texte = Why would this formula work 'pasted' on the invoice page as just plain code, but the formula from the database come up with errors. The minute my total goes over 300.00 I start getting the error. The code placed on the page comes up just fine the code placed in the shipcost.db errors out.[showif [shiptypemethod]=UPS][math show=f]rate=13.95[/math][showif [subtotal]<200.01][math show=f]rate=10.95[/math][/showif][showif [subtotal]<100.01][math show=f]rate=8.95[/math][/showif][showif [subtotal]<50.01][math show=f]rate=6.95[/math][/showif][showif [subtotal]<30.01][math show=f]rate=4.95[/math][/showif][math][showif [subtotal]>300]([/showif](rate*1)[showif [subtotal]>300]+(floor(([subtotal]*.01))*4.95))[/showif][/math][/showif]In my case the subtotal is $890.00 dollars. Hence the base shipping rate is 13.95, since the subtotal is over $300.00 the subtotal is multiplied by .01 giving me a figure of 8.9. I request the floor and return the value of 8. I then multiply it by 4.95 giving me a total of 39.60. The total of my formula as pasted into my invoice page is correctly 53.55. The total from the shipcost.db is 39.60. The value of the variable Shipmethod is SPHere is my shipcost.dbShipMethod ShipCost SS 14.95 FR 0.00 SP [showif [shiptypemethod]=UPS][math show=f]rate=13.95[/math][showif [subtotal]<200.01][math show=f]rate=10.95[/math][/showif][showif [subtotal]<100.01][math show=f]rate=8.95[/math][/showif][showif [subtotal]<50.01][math show=f]rate=6.95[/math][/showif][showif [subtotal]<30.01][math show=f]rate=4.95[/math][/showif][math][showif [subtotal]>300]([/showif](rate*1)[showif [subtotal]>300]+(floor(([subtotal]*.01))*4.95))[/showif][/math][/showif]If ya wanna know why all the extra parenthesis, Its just part of the trouble shooting method I was using. Associated Messages, from the most recent to the oldest:

    
  1. Shipping Math (Bob Minor 1999)
Why would this formula work 'pasted' on the invoice page as just plain code, but the formula from the database come up with errors. The minute my total goes over 300.00 I start getting the error. The code placed on the page comes up just fine the code placed in the shipcost.db errors out.[showif [shiptypemethod]=UPS][math show=f]rate=13.95[/math][showif [subtotal]<200.01][math show=f]rate=10.95[/math][/showif][showif [subtotal]<100.01][math show=f]rate=8.95[/math][/showif][showif [subtotal]<50.01][math show=f]rate=6.95[/math][/showif][showif [subtotal]<30.01][math show=f]rate=4.95[/math][/showif][math][showif [subtotal]>300]([/showif](rate*1)[showif [subtotal]>300]+(floor(([subtotal]*.01))*4.95))[/showif][/math][/showif]In my case the subtotal is $890.00 dollars. Hence the base shipping rate is 13.95, since the subtotal is over $300.00 the subtotal is multiplied by .01 giving me a figure of 8.9. I request the floor and return the value of 8. I then multiply it by 4.95 giving me a total of 39.60. The total of my formula as pasted into my invoice page is correctly 53.55. The total from the shipcost.db is 39.60. The value of the variable Shipmethod is SPHere is my shipcost.dbShipMethod ShipCost SS 14.95 FR 0.00 SP [showif [shiptypemethod]=UPS][math show=f]rate=13.95[/math][showif [subtotal]<200.01][math show=f]rate=10.95[/math][/showif][showif [subtotal]<100.01][math show=f]rate=8.95[/math][/showif][showif [subtotal]<50.01][math show=f]rate=6.95[/math][/showif][showif [subtotal]<30.01][math show=f]rate=4.95[/math][/showif][math][showif [subtotal]>300]([/showif](rate*1)[showif [subtotal]>300]+(floor(([subtotal]*.01))*4.95))[/showif][/math][/showif]If ya wanna know why all the extra parenthesis, Its just part of the trouble shooting method I was using. Bob Minor

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:

Images in WebCat (2000) OFF-TOPIC: Lending investors ... (2002) Practice runs ? (1997) Wierd thing in ViewOrder.tpl (1999) question: writing files textb in webmerch (1997) Help!!!! Purchases not going through! FIXED! (1997) Gantt style chart (2004) text size limitation (1997) displaying New products (using [date]) (1997) Site Builder & IE Mac (2004) Strange Question (2003) syntax question, not in online refernce (1997) Memory Leak (2000) Another option (2005) [WebDNA] WebDNA as cgi app (was WebSite Examples) (2008) Document Contains No Data! (1997) [BoldWords] WebCat.acgib15Mac (1997) [WriteFile] problems (1997) [TaxableTotal] - not working with AOL and IE (1997) how to add to triggers.db (1998)