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:
Writing multiple data into one field (1998)
Where's 3.0 Online Docs? (1999)
show all problem (1997)
PhotoMill -> PhotoMaster (1997)
Shopping Cart Problem (1998)
Extended [ConvertChars] (1997)
PCS Frames (1997)
Shipping charges depending on tax rate? (1997)
WebDNA still will not start on restart (2002)
Shared Webstar Directory (1998)
subscribe (2007)
searchable list archive (1997)
creates folders with AS (1997)
Re:2nd WebCatalog2 Feature Request (1996)
[WebDNA] Handy (2009)
text to UTF8 (2003)
Showing unopened cart (1997)
sending two mails from one template (2004)
payflowpro problem #2 (2003)
no country? (1998)