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 thousands 14.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 thousands 14.1f]usprice*1.4[/format]+.05[/math][/format] ... and to put both of them together with a price break between higher priced items and lower priced items of US$9.95 and US$9.96, do something like this:[showif [usprice]>9.95][format thousands 14.2f][math][format thousands 14.0f][math](usprice*1.4)-0.45[/math][/format]+.95[/math][/format][/showif][hi deif [usprice]>9.95][format thousands 14.2f][math][format thousands 14.1f]usprice*1.4[/format]+.05[/math][/format][/hideif]Sincerely, Ken Grome WebDNA Solutions 808-737-6499 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)
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 thousands 14.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 thousands 14.1f]usprice*1.4[/format]+.05[/math][/format] ... and to put both of them together with a price break between higher priced items and lower priced items of US$9.95 and US$9.96, do something like this:[showif [usprice]>9.95][format thousands 14.2f][math][format thousands 14.0f][math](usprice*1.4)-0.45[/math][/format]+.95[/math][/format][/showif][hi deif [usprice]>9.95][format thousands 14.2f][math][format thousands 14.1f]usprice*1.4[/format]+.05[/math][/format][/hideif]Sincerely, Ken Grome WebDNA Solutions 808-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:

Ultimate BB (2001) WebCat2 several catalogs? (1997) webCatalog and Stocks (1998) Help! WebCat2 bug (1997) math on date? (1997) WebDNA Grep help wanted (2004) WebCat with WebTen (1998) 4.5 License (2005) unitshipcost vs shipcosts (1997) Too Much Rootbeer Free Offer (1997) Server IP address? (1998) WebCat control of Print (2001) $Quit, $CloseDatabase corrections (1997) Currency Conversion (2003) Protect vs Authenicate (1997) Summing fields (1997) Using Protection =) (2003) PC Cookie Problem? (2003) Emailer port change (1997) Encyption mail (1998)