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:

searching by date (1998) ListFields and [name] (1997) OT: print landscape (2003) [WebDNA] MD5 encryption (2011) An easy one (1999) form data submission get (1997) [OT] will work for... (2003) WebStar Secure on other machine (1997) Using [showif] within [lineitems] (2000) Can't Update records (1997) ColdFusion v. WebDNA (2004) max page views Mac can handle (1999) Secure Server basic question... (1997) Quick ShowIf question (1997) Nested tags count question (1997) Desperatly seeking (2000) Single Link browsing (1997) Help name our technology! (1997) japanese characters (1997) trouble updating records in database (1998)