Using this to set a shape meter, which works, but it gives four errors, why?
X=([mFUsed:]/[mFTotal:]*150)+15
ERROR: Formula: Division by 0: (7911505920/0*150)+15
The drive is plugged in, so why the zero for mFTotal? The skin shows all details correctly.
It is currently September 19th, 2024, 12:56 am
Nested Conditions + Formulas
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
Last edited by sl23 on July 19th, 2024, 2:03 pm, edited 3 times in total.
57686174 77696C6C 6265 77696C6C 6265
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
I checked WikiHow for how to work out percentages and the formula looks correct as it gives the correct drive percentage that I set it to obtain. But the meter keeps saying in the log that the Total space is zero in the formula. Even though the About/Skins shows it's value?
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 16552
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Nested Conditions + Formulas
sl23 wrote: ↑July 18th, 2024, 3:17 pm I'm also trying to figure out why this isn't working:Is it incorrect syntax?Code: Select all
Hidden=([#m[#CURRENTSECTION]]=1 ? [UL:W]+2 : [UL:W]#BarW#+2)
Returning to this: what do you want to do when the condition is not met? I mean that the [UL:W]#BarW#+2 part of the formula (which should be calculated when the value of the appropriate measure is not 1) can't work. Combining together the width of the [UL] meter and the #BarW# variable does nothing. If you meant the product of those you should use the product operation: [UL:W]*#BarW#+2. If you meant something else, please let us know what did you want to achieve.
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
Er, so this is the formula without any Variables:
Hidden=(mUpLoad=1 ? [UL:W]+2 : [UL:W]12+2)
So I'm trying to get the meter to basically hide and move position with the above and this X=2R.
If it helps, here's the full skin code:
The idea is to use the #Disabled# Variable to hide meters you don't want to use. At the same time, move the ones on the right, to the left of the previous meter that is shown. But leaving a small gap of 2 pixels between them.
Each Bar has a width and a 2pixel spacer. When you hide one of the bars, it hides the Bar and the spacer, thus moving the Bars on the right to the left by #BarW#+2. Hope that makes sense?
Thanks.
Hidden=(mUpLoad=1 ? [UL:W]+2 : [UL:W]12+2)
So I'm trying to get the meter to basically hide and move position with the above and this X=2R.
If it helps, here's the full skin code:
Each Bar has a width and a 2pixel spacer. When you hide one of the bars, it hides the Bar and the spacer, thus moving the Bars on the right to the left by #BarW#+2. Hope that makes sense?
Thanks.
Last edited by sl23 on July 19th, 2024, 3:12 pm, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 8171
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Nested Conditions + Formulas
This one here is where (and why) you should add that 0.00001 'epsilon' value to the divisor to avoid the division by 0 error, like already mentioned.
This one is different from the above. It's probably an error appearing in the log at skin load / refresh time, when the measure didn't yet get the drive's total size. No need to worry about this one, unlike the one above, especially if things work otherwise.
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
Ok thanks, I just don't like having the errors!
Edit: Just searched for Epsilon, I missed that part of the post, sorry.
Edit: Just searched for Epsilon, I missed that part of the post, sorry.
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 8171
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Nested Conditions + Formulas
https://forum.rainmeter.net/search.php?keywords=Epsilon&terms=all&author=Yincognito&sc=1&sf=all&sr=posts&sk=t&sd=d&st=0&ch=300&t=0&submit=Search
It's up to you to 'get it', I already explained its purpose, and you have it used in multiple skins already.
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
Yeah that's what I meant, I missed that part!
I know, I'm trying, but it's difficult when you don't know the way these things work, there limits, what you can and can't do.
The manual doesn't give much info on formulas and what does/doesn't work inside them, as it's assumed you know what you're doing.
But what are the limits of using Section Variables in them? Is there any info on what can/can't be done? Like combining things like above into something like this: X=([mFTotal]<1 ? 0.00001 : (([mFUsed:]/[mFTotal:]*150)+15))
I know, I'm trying, but it's difficult when you don't know the way these things work, there limits, what you can and can't do.
The manual doesn't give much info on formulas and what does/doesn't work inside them, as it's assumed you know what you're doing.
But what are the limits of using Section Variables in them? Is there any info on what can/can't be done? Like combining things like above into something like this: X=([mFTotal]<1 ? 0.00001 : (([mFUsed:]/[mFTotal:]*150)+15))
Last edited by sl23 on July 19th, 2024, 2:44 pm, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 8171
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Nested Conditions + Formulas
I don't know how you could have missed it, since you were the one asking for an explanation on it in the first place...
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
It was a one liner and I was focusing on the solution to my problem at the time, sorry bout that.
57686174 77696C6C 6265 77696C6C 6265