RE:It just Does't add up!!!

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 15136
interpreted = N
texte = Ken, I removed the sapces... But this did not do anything... I also cleaned up what I really wanted.Below is the original message and the modifications + added a 50 loop for testing 0.05 increments to number 0.Grant, I would like to keep a databease for these shipping charges but then I would have administer them... I would prefer this calculation... At least then when some rich person wants 500 items then the calculation would handle them!format .1f still doesn't work in my manual example in the code!!!I'm assuming that format will round up at x.x5 and not sometimes at x.x5 or x.x6 !!!Look at the manual example that is in my codeyou can also take a look at my url: http://www.conexus.com.au/webcatalog/conexus/markocalculation.tmplMarko---------------------------------- Marko Bernyk ---------------------------------- Senior System Engineer Technical Services Conexus Pty Ltd Sydney, Australia e-mail: marko@conexus.com.au http://www.conexus.com.au ----------------------------------Hi... I cannot get this calculation to work!It works on paper but not with WebCatallog!All I want to do is: For every 2 items only charge 1 delivery ie: 1-2 items =$10, 3-4 items =$20, 5-6 items =$30, 7-8 items =$40I have to use [math] for the calculation and [format .1f] to do the rounding up... as you can inly round up in the decimal places!Please take a look at the .tmpl file below and see it my math is incorrect or my coding is missing something!It is best viewed from web browser.WebStar 2.1 and WebCatalog Plugin 2.0Thanx Marko---------------------------------- Marko Bernyk ---------------------------------- Senior System Engineer Technical Services Conexus Pty Ltd Sydney, Australia e-mail: marko@conexus.com.au http://www.conexus.com.au ---------------------------------- ------markocalculations.tmpl--------- For every 2 items only charge 1 delivery
ie: 1-2 items =$10, 3-4 items =$20, 5-6 items =$30, 7-8 items =$40

Simple... Work this out on paper

1 item
Half this = 0.5
Divide by 10 = 0.05
Round Up with [format .1f] = 0.1
Times by 10 = 1

2 items
Half this = 1
Divide by 10 = 0.1
Round Up with [format .1f] = 0.1
Times by 10 = 1

3 items
Half this = 1.5
Divide by 10 = 0.15
Round Up with [format .1f] = 0.2
Times by 10 = 2

4 items
Half this = 2
Divide by 10 = 0.2
Round Up with [format .1f] = 0.2
Times by 10 = 2

5 items
Half this = 2.5
Divide by 10 = 0.25
Round Up with [format .1f] = 0.3
Times by 10 = 3

Etc...

Here is how rounding works!
--------
Format Floating Point Numbers to 1 decimal place should round up at .x5

1.04=[format .1f]1.04[/format]
1.05=[format .1f]1.05[/format]
1.06=[format .1f]1.06[/format]

1.14=[format .1f]1.14[/format]
1.15=[format .1f]1.15[/format]
1.16=[format .1f]1.16[/format]

1.24=[format .1f]1.24[/format]
1.25=[format .1f]1.25[/format]
1.26=[format .1f]1.26[/format]

1.34=[format .1f]1.34[/format]
1.35=[format .1f]1.35[/format]
1.36=[format .1f]1.36[/format]
[loop start=1&end=50&advance=1] [/loop]
Number (Increments 0.05Roundup .1f
[math]number[/math][format .1f][math]number[/math][/format]

----Here are my calculations in a LOOP... they don't work!----

[loop start=1&end=50&advance=1] [/loop]
#items/2/10Roundup*10Total
[math]item[/math][math]roundup=temp/2[/math][math]roundup=roundup/10[/math][math]roundup=[format .1f][math]roundup[/math][/ format][/math][math]total=roundup*10[/math]$[math]total*10[/math]
Associated Messages, from the most recent to the oldest:

    
  1. RE:It just Does't add up!!! (Grant Hulbert 1997)
  2. RE:It just Does't add up!!! (Grant Hulbert 1997)
  3. RE:It just Does't add up!!! (Bob Minor 1997)
  4. RE:It just Does't add up!!! (Marko Bernyk 1997)
  5. RE:It just Does't add up!!! (Grant Hulbert 1997)
  6. RE:It just Does't add up!!! (Marko Bernyk 1997)
  7. RE:It just Does't add up!!! (Grant Hulbert 1997)
  8. RE:It just Does't add up!!! (Marko Bernyk 1997)
Ken, I removed the sapces... But this did not do anything... I also cleaned up what I really wanted.Below is the original message and the modifications + added a 50 loop for testing 0.05 increments to number 0.Grant, I would like to keep a databease for these shipping charges but then I would have administer them... I would prefer this calculation... At least then when some rich person wants 500 items then the calculation would handle them!format .1f still doesn't work in my manual example in the code!!!I'm assuming that format will round up at x.x5 and not sometimes at x.x5 or x.x6 !!!Look at the manual example that is in my codeyou can also take a look at my url: http://www.conexus.com.au/webcatalog/conexus/markocalculation.tmplMarko---------------------------------- Marko Bernyk ---------------------------------- Senior System Engineer Technical Services Conexus Pty Ltd Sydney, Australia e-mail: marko@conexus.com.au http://www.conexus.com.au ----------------------------------Hi... I cannot get this calculation to work!It works on paper but not with WebCatallog!All I want to do is: For every 2 items only charge 1 delivery ie: 1-2 items =$10, 3-4 items =$20, 5-6 items =$30, 7-8 items =$40I have to use [math] for the calculation and [format .1f] to do the rounding up... as you can inly round up in the decimal places!Please take a look at the .tmpl file below and see it my math is incorrect or my coding is missing something!It is best viewed from web browser.WebStar 2.1 and WebCatalog Plugin 2.0Thanx Marko---------------------------------- Marko Bernyk ---------------------------------- Senior System Engineer Technical Services Conexus Pty Ltd Sydney, Australia e-mail: marko@conexus.com.au http://www.conexus.com.au ---------------------------------- ------markocalculations.tmpl--------- For every 2 items only charge 1 delivery
ie: 1-2 items =$10, 3-4 items =$20, 5-6 items =$30, 7-8 items =$40

Simple... Work this out on paper

1 item
Half this = 0.5
Divide by 10 = 0.05
Round Up with [format .1f] = 0.1
Times by 10 = 1

2 items
Half this = 1
Divide by 10 = 0.1
Round Up with [format .1f] = 0.1
Times by 10 = 1

3 items
Half this = 1.5
Divide by 10 = 0.15
Round Up with [format .1f] = 0.2
Times by 10 = 2

4 items
Half this = 2
Divide by 10 = 0.2
Round Up with [format .1f] = 0.2
Times by 10 = 2

5 items
Half this = 2.5
Divide by 10 = 0.25
Round Up with [format .1f] = 0.3
Times by 10 = 3

Etc...

Here is how rounding works!
--------
Format Floating Point Numbers to 1 decimal place should round up at .x5

1.04=[format .1f]1.04[/format]
1.05=[format .1f]1.05[/format]
1.06=[format .1f]1.06[/format]

1.14=[format .1f]1.14[/format]
1.15=[format .1f]1.15[/format]
1.16=[format .1f]1.16[/format]

1.24=[format .1f]1.24[/format]
1.25=[format .1f]1.25[/format]
1.26=[format .1f]1.26[/format]

1.34=[format .1f]1.34[/format]
1.35=[format .1f]1.35[/format]
1.36=[format .1f]1.36[/format]
[math]number=0[/math]> [loop start=1&end=50&advance=1] [math]number=number+0.05[/math]> [/loop]
Number (Increments 0.05Roundup .1f
[math]number[/math][format .1f][math]number[/math][/format]

----Here are my calculations in a LOOP... they don't work!----

[math]temp=1[/math]> [math]item=1[/math]> [math]total=0[/math]> [loop start=1&end=50&advance=1] [math]roundup=0[/math]> [math]total=0[/math]> [math]item=item+1[/math]> [math]temp=item[/math]> [/loop]
#items/2/10Roundup*10Total
[math]item[/math][math]roundup=temp/2[/math][math]roundup=roundup/10[/math][math]roundup=[format .1f][math]roundup[/math][/ format][/math][math]total=roundup*10[/math]$[math]total*10[/math]
Marko Bernyk

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:

Date Help! (2003) [math] show=F exists? (1997) Linux ODBC and the ODBC Bridge (2000) passing info to thankyou.tpl (1998) Apology to list (2002) OFF-TOPIC: Free webdna.net email addresses ... (2003) html being uncooperative (2000) How To question on setting up downloads (1997) RE: Languages (1997) searchable list archive (1997) Server Load (2000) WebCatalog can't find database (1997) CERT Advisory on malicious scripts (2000) international time (1997) [OT] Changing permissions on W2003 via FTP (2007) RE: Signal Raised (1997) [url] issue (2000) WebCat2b12 CGI Mac - [shownext] problem (1997) case number with spaces. (2000) WebCat for mass emailings (1997)