Hi,
I have a meter displaying my cpu usage as a percentage. When the usage is >10%, (37%, for example) two digits are used. When the usage is <10%, however (e.g. 5%) only one digit is used. My question is, then, how does one manipulate the skin's code so that the meter is displayed to 2 significant figures at all times?
It is currently October 14th, 2024, 8:57 pm
String Meter: Significant figures
-
- Posts: 1
- Joined: June 19th, 2010, 1:58 pm
-
- Posts: 667
- Joined: April 18th, 2010, 2:16 pm
- Location: NY, USA
Re: String Meter: Significant figures
In the Measure, add:
Substitute="1":"01","2":"02","3":"03",etc...
Do that up to 9, and it may take a little tinkering.
Search for Substitutes if you need more help on it.
Substitute="1":"01","2":"02","3":"03",etc...
Do that up to 9, and it may take a little tinkering.
Search for Substitutes if you need more help on it.
-
- Developer
- Posts: 263
- Joined: July 31st, 2009, 2:23 pm
- Location: Tokyo, JPN
Re: String Meter: Significant figures
Try this
Code: Select all
[MeasureCPU]
Measure=CPU
[MeasureCalc]
Measure=Calc
Formula=MeasureCPU / 10
Substitute=".":""
[MeterCPU]
Meter=STRING
MeasureName=MeasureCalc
NumOfDecimals=1
-
- Developer
- Posts: 2873
- Joined: April 17th, 2009, 12:18 pm
Re: String Meter: Significant figures
That wouldn't work (11% CPU would become 0101%)..JpsCrazy wrote:Substitute="1":"01","2":"02","3":"03",etc...
Do that up to 9, and it may take a little tinkering.
-
- Posts: 667
- Joined: April 18th, 2010, 2:16 pm
- Location: NY, USA
Re: String Meter: Significant figures
That's very, very true.poiru wrote: That wouldn't work (11% CPU would become 0101%)..
Well, I think kenz0's way would work.