Rounding problem

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 21966
interpreted = N
texte = I can't find a solution in some rounding situations. Here's a case that illustrates perfectly my problem:[math]change=40.807[/math] [format .2f][math]x1=250/change[/math][/format] => 6.13 [format .2f][math]x2=6.13*0.21[/math][/format] => 1.29 [format .2f][math]x1+x2[/math][/format] => 7.41 instead of 7.42 (6.13+1.29)Is there a way to get 7.42? This simple question is a serious issue for me. I have a lot of use of this structure with more complex calculations. Is there a mean to tell to webcatalog to store, for example, exactly 6.13 into x1 (or another variable) and not the result with all the decimals. That could ne a workaround, I think.helene Associated Messages, from the most recent to the oldest:

    
  1. Re: Rounding problem (helene 1998)
  2. Re: Rounding problem (Dave MacLeay 1998)
  3. Rounding problem (abarguia 1998)
I can't find a solution in some rounding situations. Here's a case that illustrates perfectly my problem:[math]change=40.807[/math] [format .2f][math]x1=250/change[/math][/format] => 6.13 [format .2f][math]x2=6.13*0.21[/math][/format] => 1.29 [format .2f][math]x1+x2[/math][/format] => 7.41 instead of 7.42 (6.13+1.29)Is there a way to get 7.42? This simple question is a serious issue for me. I have a lot of use of this structure with more complex calculations. Is there a mean to tell to webcatalog to store, for example, exactly 6.13 into x1 (or another variable) and not the result with all the decimals. That could ne a workaround, I think.helene abarguia

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:

dates and hex formatting (1997) MacAuthorize order data fields WAS:How To question... (1997) Parameter Passing (2000) Dummy Credit Card Number for debug? (1997) Showing Results Alphabetically in Columns (top to bottom) (2002) Trouble with formula.db (1997) [subTotal] pricefield in another database !? (1998) Server Traffic Simulation (1998) test for John (1999) How much is too much? I can never remember the answer. (2002) Trouble with emailer (2000) sendmail for email (was Netforms) (1998) 10.4 Tiger Server with webdna (2005) Multiple catalog databases and showcart (1997) [taxRate] [TaxTotal] ? (1997) Snake Bites (1997) WebCat2 - Getting to the browser's username/password data (1997) Initiating NewCart (1997) Using [Include] Context (1999) WC --> printer (1998)