Re: Round up prices
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 31319
interpreted = N
texte = OK that makes sense now. Round to nearest even integer for floating point values, nearest even multiple of 10 for 5, etc. That explains whythere are rounding rules in Math::BigFloat that round to even, round toodd, round to zero, round to infinity, etc.There is always going to be a limitation of how this is going to be dealt with in code. I still think that rounding .5 down is theexceptionrather than the rule, and not how WebCat does it apparently.John PeacockChrister Olsson wrote:> > >Ah, it was the Swedes.> > It's always the Swedes (you'll soon see in S:t Petersburg ;-)> > > But tell me, how is 25 closer to 20 than 30?> >3*10 - 25 = 5> >25 - 2*10 = 5???> >> >Is there an additional digit 20 and something that causes it to> >attract the rounding? Do you mean round to the nearest power of 10?> > English is not my native language so honestly I have no idea if I mean the nearest power of 10.> > .5 is rounded to nearest even integer, like: 1.5 is rounded to 2, 3.5 is rounded to 4 and 6.5 is rounded to 6. Multiply with 10 and you get how 5, 15 and so on is rounded.> > *************************************************************> Christer Olsson Stora Nygatan 21 Phone +46 40 791 50> Ljusa Idéer AB S-211 37 Malmoe Fax +46 40 97 99 77> Sweden http://www.ljusaideer.se> > -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list
.> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to -------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
OK that makes sense now. Round to nearest even integer for floating point values, nearest even multiple of 10 for 5, etc. That explains whythere are rounding rules in Math::BigFloat that round to even, round toodd, round to zero, round to infinity, etc.There is always going to be a limitation of how this is going to be dealt with in code. I still think that rounding .5 down is theexceptionrather than the rule, and not how WebCat does it apparently.John PeacockChrister Olsson wrote:> > >Ah, it was the Swedes.> > It's always the Swedes (you'll soon see in S:t Petersburg ;-)> > > But tell me, how is 25 closer to 20 than 30?> >3*10 - 25 = 5> >25 - 2*10 = 5???> >> >Is there an additional digit 20 and something that causes it to> >attract the rounding? Do you mean round to the nearest power of 10?> > English is not my native language so honestly I have no idea if I mean the nearest power of 10.> > .5 is rounded to nearest even integer, like: 1.5 is rounded to 2, 3.5 is rounded to 4 and 6.5 is rounded to 6. Multiply with 10 and you get how 5, 15 and so on is rounded.> > *************************************************************> Christer Olsson Stora Nygatan 21 Phone +46 40 791 50> Ljusa Idéer AB S-211 37 Malmoe Fax +46 40 97 99 77> Sweden http://www.ljusaideer.se> > -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to -------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
John Peacock
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:
fresh eyes needed. Append won't work. (2000)
WebCat2b13MacPlugIn - [include] (1997)
Cart -> Date and Time (2004)
docs for WebCatalog2 (1997)
Problem with summary on date / inconsequent webcat behaviour (1998)
Bug or syntax error on my part? (1997)
Special delete ... (1997)
why .HTML pages no processing? (2000)
WebCatalog 2.0 b 15 mac (1997)
Discounting prices across a site (1997)
[INCLUDE] Limitations (1998)
one item in several different categories? (2000)
Max Record length restated as maybe bug (1997)
Sorting LISTFILES (1997)
LOOP and IF statements (1997)
Silly Question (1997)
How do I specify a & character in Grep? (2000)
Form/HTML Help (2000)
Suggestions on best way to work with yyyy/mm/dd (1997)
WebCat2 - [include] tags (1997)