User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21

Thread: Rounding numbers or.....

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Rounding numbers or.....

    I have a calculation that returns 12.159437866803227. I would like to round that number to 12.159 or just lose the last 12 digits after the 9. Is this possible? The expression editor calculation is written like this: ( 234 ) * ( ( HP * 1.0 / Weight * 1.0 ) pow 0.3333 )
    I even tried: Round ( 234 ) * ( ( HP * 1.0 / Weight * 1.0 ) pow 0.3333 ) and it still returns 12.159437866803227
    Any help with this would be great. BTW, this only happens when running this in HTML5. All other run times return shorter numbers.

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your brackets are a little off.

    It should be either
    234* (HP*1.0/Weight*1.0)Pow 0.3333
    or
    Round(234* (HP*1.0/Weight*1.0)Pow 0.3333)

    To round to a specific number of decimals (3 in this case) try this:
    Round((234* (HP*1.0/Weight*1.0)Pow 0.3333)*1000)/1000.0

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ok, that worked for that expression, but how would I set this one up to give me 3 digits after the decimal point! The second expression in the picture. Thank you again for helping me out!
    Images attachées Images attachées

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Round((1353.0/MPH)*1000)/1000

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is this just how HTML5 handles float numbers? Is that the reason it's fine on PC and Android because they handle floats differently? Thank you for the expression fix. I'll try the new one you just posted when I get in front of my PC.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry,..how would this be written to round the number like the others? SetText....
    Str$(1353.0 / Val(Edittext$( "E5" )
    I am so confused with the expression editor it isn't even funny! I tried this:
    Str$(1353.0 / Val(Edittext$( "E6" ) * 1000 / 1000.0
    But it says "Mixed strings and numbers" in the expression editor.

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Str$(Round((1353.0/Val(Edittext$("E5"))*1000)/1000)

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thank you, but the expression editor is saying "Missing closed bracket?? When I click "where?" it's saying in front of "Round", but I enter one and it doesn't work?

  9. #9
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, typo.
    there should be 3 close brackets after E5:
    Str$(Round((1353.0/Val(Edittext$("E5")))*1000)/1000)

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Perfect!! Thank you again for the fast response. This was a big help and hopefully I'll learn something from this! For some reason, I just can't get my head around the expression editor and writing my own. It seems very difficult.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Random Numbers and expiring the result numbers.
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th April 2013, 04:11 PM
  2. Rounding issues
    By Arnax in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 24th February 2012, 08:17 AM
  3. Rounding Down
    By etrose in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th November 2011, 11:32 AM
  4. Rounding up/down
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 17th June 2007, 11:43 AM
  5. Rounding numbers
    By The_Alee in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th September 2006, 09:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •