I'm trying to make a counter display the percent that X is of Y.
So I do, 100 - (((Y - X) / Y) * 100)
Lets give an example.
y = 7400
x = 600
100 - (((7400 - 600) / 7400) * 100)
100 - (((6800) / 7400) *100)
100 - (0.919 * 100)
100 - 91.9
8.1
Right?
Well how come when I put that into MMF it gives me 0 when X = 0. And 100 when X = anything else?
Is it just a flaw with the default counter object or is there something I'm doing wrong?
When I just do 1.0 when I click okay on the dialog it removes the decimal,
When I do something like
Always -> Set Counter -> 100-( (value( "Y" -value( "X" ))/(value( "Y" )*1.0))*100.001)
I get
X = 0, Z = 0.000000000000099921312
X > 0, Z = 100
Edit:
I added *0.1*10 to it after the first value Y and it seems to be working, only thing is when both values are 0 it comes out to "1e+009"
But deviding by 0 might be the issue there
Thanks man.
Originally Posted by Sketchy I don't know where you got that crazy formula!
Just say:
(X * 100) / Y
Lol, Yeah I don't know what I was thinking, I realized that when I woke up this morning. I find the opposite percent just to find the opposite of the opposite.
Edit:
When I use yours it only carries to the 2nd decimal, when I use my original it carries for the 4th decimal, no idea why.