Wanted: More Math Functions (or, Can You Solve This?)
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 14029
interpreted = N
texte = HeHe ... of course I can solve it! :)>I'm trying to come up with a formula that will convert our US prices to our>Canadian prices.>>For higher priced items, we take the US price, multiply by 1.4, and round>up to the nearest 95 cents (eg, $6.95 would go to $9.95).This will work:[format thousands 14.2f][math][format thousands14.0f][math](usprice*1.4)-0.45[/math][/format]+.95[/math][/format]>For lower priced items, we take the US price, multiply by 1.4, and round up>to the nearest 5 cents (eg, $2.95 would go to $4.15).This will work:[format thousands 14.2f][math][format thousands14.1f]usprice*1.4[/format]+.05[/math][/format]... and to put both of them together with a price break betweenhigher priced items and lower priced items of US$9.95 andUS$9.96, do something like this:[showif [usprice]>9.95][format thousands 14.2f][math][formatthousands14.0f][math](usprice*1.4)-0.45[/math][/format]+.95[/math][/format][/showif][hideif [usprice]>9.95][format thousands 14.2f][math][format thousands14.1f]usprice*1.4[/format]+.05[/math][/format][/hideif]Sincerely, Ken GromeWebDNA Solutions808-737-6499
Associated Messages, from the most recent to the oldest:
| |
- Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (bob 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (Michael Winston 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
- Wanted: More Math Functions (or, Can You Solve This?) (Michael Winston 1997)
- Wanted: More Math Functions (or, Can You Solve This?) (Kenneth Grome 1997)
- Re: Wanted: More Math Functions (or, Can You Solve This?) (Grant Hulbert 1997)
|
HeHe ... of course I can solve it! :)>I'm trying to come up with a formula that will convert our US prices to our>Canadian prices.>>For higher priced items, we take the US price, multiply by 1.4, and round>up to the nearest 95 cents (eg, $6.95 would go to $9.95).This will work:[format thousands 14.2f]
[math][format thousands14.0f]
[math](usprice*1.4)-0.45[/math][/format]+.95[/math][/format]>For lower priced items, we take the US price, multiply by 1.4, and round up>to the nearest 5 cents (eg, $2.95 would go to $4.15).This will work:[format thousands 14.2f]
[math][format thousands14.1f]usprice*1.4[/format]+.05[/math][/format]... and to put both of them together with a price break betweenhigher priced items and lower priced items of US$9.95 andUS$9.96, do something like this:[showif [usprice]>9.95][format thousands 14.2f]
[math][formatthousands14.0f]
[math](usprice*1.4)-0.45[/math][/format]+.95[/math][/format][/showif][hideif [usprice]>9.95][format thousands 14.2f]
[math][format thousands14.1f]usprice*1.4[/format]+.05[/math][/format][/hideif]Sincerely, Ken GromeWebDNA Solutions808-737-6499
Kenneth Grome
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:
TCP connect, how long does it take (PCS please) (1999)
Re:Emailer and encryption (1997)
formula inside database to calculate weights (1997)
Preloading code? (2002)
blank page from template (1997)
WebCatalog for guestbook ? (1997)
Setting up shop (1997)
quantity minimum problem (1997)
Searchable WebCat (etc.) Docs ? (1997)
[WebDNA] Data Type Bool (2009)
OT: Hello to the list (2004)
Database Structure? (1998)
Server problem? (1998)
Crashing Server (2000)
Running _every_ page through WebCat ? (1997)
Include Troubles (1998)
[include] error message (was:how to put/keep productcustomization info in basket?) (1998)
SiteEdit Pro Update Announcement (1997)
The beginning (1997)
psst (1997)