User Tag List

Results 1 to 7 of 7

Thread: How to use the "%" sign with the event editor?

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to use the "%" sign with the event editor?

    (Keep in mind I don't know much about math... :blush



    I'm using an edit object and a counter object. I want to take the given input number from the edit object and output that number plus 4%, onto the counter object. How can I do that?


    By the way, are there any other more effective objects I could be using for input/output of numbers and doing simple math operations with them? Currently I'm using edit objects and counter objects, but I find they have limits. Counter objects can only use up to 10 digits or so. Another problem is that these objects seem to be making correct math operations with their own kind only. If I recall corectly, when I tried to make operations between a counter object and an edit object, the results were unpredictable.

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2008
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use the "%" sign with the event editor?

    you mean mod or percent?

    I think you mean percent. It is as easy as multiply *percent/100
    so, the 4% of a value is (value*4)/100

    You can also do it directly doing this:

    value*0.04

    if you want to get the value plus a 4%, then, you have to make a 100% + a 4%, so you can do it as above without doing the operation twice:

    (value*104)/100

    or

    value*1.04

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use the "%" sign with the event editor?

    Okies!

    a + [4% of a]

    = a * 1.04

    That'll do it. So if you want to get a counter + 4% of that counter, you do:

    value("Counter")*1.04

    The '1' of 1.04 represents 100% (the number as it currently stands). the '.04' represents the 4% that we want to add on top of it.

    So some examples:

    a*0.50 = 50% of a
    a*0.20 = 20% of a
    a*1.00 = 100% of a
    a*2.00 = 200% of a
    a*1.40 = 140% of a (a + 40%)

    Irregularities

    For simplicity, computers don't always use Floats (decimal point numbers). Otherwise you can imagine the nightmare handling infinitely recurring numbers. MMF is one such example, it doesn't natively give you decimals when you divide.

    So 5/2 in MMF will = 2, not 2.5. This is because MMF simply strips off the decimal part.

    To fix it, you have to tell MMF it must divide using floats, and to do that we simply do this:

    5.0/2.0

    You need to have the '.0' at the end.

    However, suppose you do this:

    value("A") / value("B")

    In this case you can't simply add '.0'. You have to do this:

    value("A") / (value("B")+0.0)

    That's enough to tell MMF that we're dealing with decimals and need floating point precision.

    Lol, I hope that makes sense!!

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use the "%" sign with the event editor?

    Hi Blue Frenzy. That was fast! Your very last sentence (value*1.04) was exactly what I was looking for. It worked, thank you

  5. #5
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use the "%" sign with the event editor?

    Hey Dines! Wow that's more info than I could have hoped for! Thanks for taking the time

  6. #6
    No Products Registered

    Join Date
    Jun 2007
    Location
    Croatia
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use the "%" sign with the event editor?

    At times like this I wish MMF would do math with floats (maybe even double) by default and only round them when needed. I know it would be a slight performance loss, but I guess not too much.

    The way the expression editor works at the moment, correct calculations can sometimes get messy and span across too many lines.

  7. #7
    Clicker Multimedia Fusion 2 Developer
    Jax's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    702
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use the "%" sign with the event editor?

    Floats are not accurate and so often you definitely do not want to be using floats.

Similar Threads

  1. Help! - Multiple "Which animation is playing?" Conditions in same event line.
    By ezzypixel in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th October 2013, 02:18 AM
  2. [BUG] "bring to front" on Counters - can't have the action more than once per event
    By alspal in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 18th April 2012, 02:29 PM
  3. Adding Return to "Change alterable Text" event
    By Teh_Purple_d00d in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th December 2011, 01:45 AM
  4. Event Editor: Little "B" in bottom-left corner of my objects
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th December 2011, 08:08 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
  •