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 intothe [format .2f] context, instead of [format.2f]. BTW, the format contextis not necessary unless you are explicitly trying to force rounding of thenumber. You can probably leave it out and it would work OK.The best way to fix these kinds of 'mystery' problems is to paste yourformula into your invoice template so it's visible to you. Then you canusually see some odd text show up that's non-numeric or whatever else ismessing up the formula. Put |
| vertical braces aroundthe visible formula so you can see any extra spaces or other charactersthat might interfere.For more complex shipping calculations, it's often best to use a databasetable that contains the ranges you are basing shipping on, and then use[Search] in that table to zero in on the exact shipping cost. Thissimplifies things so you don't need all those nested [ShowIf]s.For example, here's one that uses zip code prefixes to determine shippingcosts:-- ZipCodes.db --BeginPrefix EndPrefix Standard SecondDay USMail000 325 1.6 1.2 1.2326 349 .8 .5 .5350 966 1.6 1.2 1.2967 999 1.8 1.4 1.4-- Formulas.db --shipCost [search db=ZipCodes.db&leBeginPrefixdatarq=[GetCharsstart=1&end=3][zip][/GetChars]&geEndPrefixdatarq=[GetCharsstart=1&end=3][zip][/GetChars]][founditems][Interpret][[shipVia]][/Interpret][/founditems][/search]Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>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 intothe [format .2f] context, instead of [format.2f]. BTW, the format contextis not necessary unless you are explicitly trying to force rounding of thenumber. You can probably leave it out and it would work OK.The best way to fix these kinds of 'mystery' problems is to paste yourformula into your invoice template so it's visible to you. Then you canusually see some odd text show up that's non-numeric or whatever else ismessing up the formula. Put || vertical braces aroundthe visible formula so you can see any extra spaces or other charactersthat might interfere.For more complex shipping calculations, it's often best to use a databasetable that contains the ranges you are basing shipping on, and then use[search] in that table to zero in on the exact shipping cost. Thissimplifies things so you don't need all those nested [showif]s.For example, here's one that uses zip code prefixes to determine shippingcosts:-- ZipCodes.db --BeginPrefix EndPrefix Standard SecondDay USMail000 325 1.6 1.2 1.2326 349 .8 .5 .5350 966 1.6 1.2 1.2967 999 1.8 1.4 1.4-- formulas.db --shipCost [search db=ZipCodes.db&leBeginPrefixdatarq=[GetCharsstart=1&end=3][zip][/GetChars]&geEndPrefixdatarq=[GetCharsstart=1&end=3][zip][/GetChars]][founditems][interpret][[shipVia]][/Interpret][/founditems][/search]Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/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)