RE:It just Does't add up!!!
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 15216
interpreted = N
texte = Ken, I removed the sapces... But this did not do anything... I alsocleaned up what I really wanted.Below is the original message and the modifications + added a 50 loop fortesting 0.05 increments to number 0.Grant, I would like to keep a databease for these shipping charges butthen I would have administer them... I would prefer this calculation... Atleast then when some rich person wants 500 items then the calculation wouldhandle 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.x5or 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 deliveryie: 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 therounding 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 isincorrect or my coding is missing something!It is best viewed from web browser.WebStar 2.1 and WebCatalog Plugin 2.0ThanxMarko---------------------------------- 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]
Number (Increments 0.05 | Roundup .1f |
[loop start=1&end=50&advance=1][math]number[/math] | [format .1f][math]number[/math][/format] |
[/loop]
----Here are my calculations in a LOOP... they don't work!----
#items | /2 | /10 | Roundup | *10 | Total |
[loop start=1&end=50&advance=1][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] |
[/loop]
Associated Messages, from the most recent to the oldest:
Ken, I removed the sapces... But this did not do anything... I alsocleaned up what I really wanted.Below is the original message and the modifications + added a 50 loop fortesting 0.05 increments to number 0.Grant, I would like to keep a databease for these shipping charges butthen I would have administer them... I would prefer this calculation... Atleast then when some rich person wants 500 items then the calculation wouldhandle 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.x5or 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 deliveryie: 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 therounding 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 isincorrect or my coding is missing something!It is best viewed from web browser.WebStar 2.1 and WebCatalog Plugin 2.0ThanxMarko---------------------------------- 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]>
Number (Increments 0.05 | Roundup .1f |
[loop start=1&end=50&advance=1][math]number[/math] | [format .1f][math]number[/math][/format] | [math]number=number+0.05[/math]>
[/loop]
----Here are my calculations in a LOOP... they don't work!----
[math]temp=1[/math]>[math]item=1[/math]>[math]total=0[/math]>
#items | /2 | /10 | Roundup | *10 | Total |
[loop start=1&end=50&advance=1][math]roundup=0[/math]>[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] |
[math]total=0[/math]>[math]item=item+1[/math]>[math]temp=item[/math]>[/loop]
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:
all records returned. (1997)
No shipping systems available? (1998)
Date problems-more (1997)
Errata: WCS Newbie question (1997)
Windows 2.1b2 Append Bug? (1997)
Banner DNA (1997)
Date search - yes or no (1997)
where to put code (1998)
Associative lookup style? + bit more (1997)
Max Record length restated as maybe bug (1997)
Out of the woodwork (2007)
Sorting by date (1997)
Emailer help....! (1997)
oops private message leaked into talk list (1997)
Whats wrong with this code? (1998)
Emailer port change (1997)
Trouble with formula.db (1997)
Re(2): Re(2): SSL, WebSTAR, WebCatalog (1998)
RE: Just a thought (1998)
Help name our technology! I found it (1997)