Clickteam Fusion 2.5

Clickteam Fusion 2.5

Zethell 2 Oct, 2024 @ 1:24am
Math issue.
Trying to calculate (100/1000) * 100 gives me 0 when it should be 10.
Trying to calculate (1000/1000) * 100 gives me 100 when it should be 100.

Nothing in-between 0 and 999 on the first value works, it just comes back as 0.
Until you hit 1000, but then 1001 to 1999 does the same thing, returns 100 when it should be higher, until you reach 2000, at which point you get 200 as intended.

My head tells me I'm doing things correctly. Google calculator tells me this should work as well. So why doesn't Clickteam Fusion allow me to do this calculation properly?

What am I missing here.
Last edited by Zethell; 2 Oct, 2024 @ 1:26am
< >
Showing 1-3 of 3 comments
Zethell 2 Oct, 2024 @ 2:02am 
Well, scouring the Internet I found a solution to calculate it as (ValueA * 100) / ValueB instead. And this works.

Someone mentioned that you need to include a float value in the calculation for (ValueA/ValueB) * 100 to work, and I did. And it still does not work.
victorzvyagin 2 Oct, 2024 @ 4:00am 
hmm, that's interesting- did you try multiplying it by 0.1 and then by 10 instead? because, that would force its logics (Normally?! (Hopefully?!)) to decimal- logics, in a way- and future calculations would be made with a decimal dot considered?!
Zethell 7 Oct, 2024 @ 2:42pm 
Originally posted by victorzvyagin:
hmm, that's interesting- did you try multiplying it by 0.1 and then by 10 instead? because, that would force its logics (Normally?! (Hopefully?!)) to decimal- logics, in a way- and future calculations would be made with a decimal dot considered?!

So what I was trying to calculate was the hit percentage from two values, "ShotsFired" and "ShotsHit".

So I added a third value called "Accuracy" as (ShotsHit / ShotsFired) * 100.
And while it wouldn't include decimals, I at the very least expect it to calculate the non-decimal value properly between 0 and 100, simply ignoring the decimals.

But this apparently bricks the calculation and it just goes from 0% to 100% to 200% etc.
Because I wanted an accurate number from the calculation, I didn't want to introduce any decimals to the values. Simply adding .0 of course does nothing.

I also tried adding a decimal of 0.1, and then deleting it at a later point before printing it, but that had the same outcome.

Still, I found a different way of doing it, and I'm happy with the results.



I had the same issue when calculating K/D, it would only go to 0, 1, 2 etc.

Taking (Kills / Deaths) it refuses to add decimals.
So I just did ((Kills+0.0001) / Deaths) and then printed it with Str$(Floor(KD( "Player" ) * 100.0) / 100.0) to only keep 2 decimals, hiding the mistake of later decimals and also keeping it at a neat 2 decimals.

A filthy work-around, but it works.
< >
Showing 1-3 of 3 comments
Per page: 1530 50