How to get the percentage of two counters without decimal ?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I need to find value „Counter” as a percentage of „ Counter 2” value. I’ve got three counters. Counter (my variable value) , Counter 2 ( This is my 100% value – it’s stable) , Counter 3 ( result in percentage ).

    I used -> Set Counter to :

    ( value( "Counter" ) + 0.0 ) / ( value( "Counter 2" ) + 0.0 ) * 100

    It works. But result is value with decimals. Is it possible to set „Counter 3” without decimalas (only full figures) ?

  • Do any of your counters ever go negative? Floor(value) could give you a problem.
    Floor(-3.5) = -4 (moves away from zero)
    Int(-3.5) = -3 (moves toward zero)

    Does counter 2 ever go to 0 or 0.0? Could give you a divide-by-zero error

  • Hi - Thank you for posting. I was having a lot of difficulty showing a percentage with decimals in an Android game. I was didiving to counter values and could not get a proper calculation. It used to work flawlessly in Clickn' Create and in Multimedia Fusion 2.0. I think they changed something in the counter code and messed up the handling of decimals. Anyway, this solves my problem. Thank you again.

    <span style="font-weight: bold"><span style="font-style: italic">'Til Later - RichC</span></span>

  • If you need -3.5 to be -3 and 3.5 to be 3 then use int(). If you want - 3.5 to be -4 and 3.5 to be 4 then use round(). Floor() will give you - 4 and 3, as mentioned above.

    And don't worry about dividing by zero. Fusion doesn't give errors for that. If an equation divides by zero, fusion just returns 0.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!