Re: ShipCost Problems

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19746
interpreted = N
texte = >I'm still having problems getting my shipping costs to calculate >properly.I tried your formula, and it works fine if you add the correct space into the [format .2f] context, instead of [format.2f]. BTW, the format context is not necessary unless you are explicitly trying to force rounding of the number. You can probably leave it out and it would work OK.The best way to fix these kinds of 'mystery' problems is to paste your formula into your invoice template so it's visible to you. Then you can usually see some odd text show up that's non-numeric or whatever else is messing up the formula. Put || vertical braces around the visible formula so you can see any extra spaces or other characters that might interfere.For more complex shipping calculations, it's often best to use a database table that contains the ranges you are basing shipping on, and then use [Search] in that table to zero in on the exact shipping cost. This simplifies things so you don't need all those nested [ShowIf]s.For example, here's one that uses zip code prefixes to determine shipping costs:-- ZipCodes.db -- BeginPrefix EndPrefix Standard SecondDay USMail 000 325 1.6 1.2 1.2 326 349 .8 .5 .5 350 966 1.6 1.2 1.2 967 999 1.8 1.4 1.4-- Formulas.db -- shipCost [search db=ZipCodes.db&leBeginPrefixdatarq=[GetChars start=1&end=3][zip][/GetChars]&geEndPrefixdatarq=[GetChars start=1&end=3][zip][/GetChars]][founditems][Interpret][[shipVia]][/Interpret][/f ounditems][/search] Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. shipCost problems (Nitai @ Eyework 2000)
  2. Re: ShipCost Problems (PCS Technical Support 1998)
  3. ShipCost Problems (Richard Kirsner 1998)
>I'm still having problems getting my shipping costs to calculate >properly.I tried your formula, and it works fine if you add the correct space into the [format .2f] context, instead of [format.2f]. BTW, the format context is not necessary unless you are explicitly trying to force rounding of the number. You can probably leave it out and it would work OK.The best way to fix these kinds of 'mystery' problems is to paste your formula into your invoice template so it's visible to you. Then you can usually see some odd text show up that's non-numeric or whatever else is messing up the formula. Put || vertical braces around the visible formula so you can see any extra spaces or other characters that might interfere.For more complex shipping calculations, it's often best to use a database table that contains the ranges you are basing shipping on, and then use [search] in that table to zero in on the exact shipping cost. This simplifies things so you don't need all those nested [showif]s.For example, here's one that uses zip code prefixes to determine shipping costs:-- ZipCodes.db -- BeginPrefix EndPrefix Standard SecondDay USMail 000 325 1.6 1.2 1.2 326 349 .8 .5 .5 350 966 1.6 1.2 1.2 967 999 1.8 1.4 1.4-- formulas.db -- shipCost [search db=ZipCodes.db&leBeginPrefixdatarq=[GetChars start=1&end=3][zip][/GetChars]&geEndPrefixdatarq=[GetChars start=1&end=3][zip][/GetChars]][founditems][interpret][[shipVia]][/Interpret][/f ounditems][/search] Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ PCS Technical Support

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:

Replace context problem ... and answers (1997) Browser Problem?!? Still getting Error message using POST! (1997) Am I going senile? (Price recalc based on quantity) (1997) authenticating a second user, the sequel (1997) WebCat2b12plugin - [search] is broken ... not! (1997) date math (2005) User Authentication (2003) Did you hear about this? (1997) [WebDNA] [BULK] Windows XP Pro Success! (2008) Problem (1997) WC2.0 Memory Requirements (1997) Closing Databases (1998) [ShowNext] feature in 2.0 (1997) Correction: New WebDNA Example from Olin -- (1998) IE cache problems (1999) Problem with broken images (2004) emailer cc to figured out (1997) WebCat2 - [include] tags (1997) IE4.5 bug FYI (1999) WebCat2.0 [format thousands .0f] no go (1997)