I've gone through the docs, I've searched, I've googled, I've skimmed the skin archives looking for someone who may have done this so I can 'borrow' the code, and hours later I've come up empty.
So here I am asking for help.
I've got a RAM and SWAP Meter that displays the values via String working fine. However due to the size of my skin I'd like to be able to remove the spaces between the value and the "byte" representation to save a bit of space.
Can this be done?
If yes, please show me how oh wise Rainmeter gurus!
TL;DR
String Meter...
What I have: 2.3 GB
What I want: 2.3GB (No space between the number and GB)
Last edited by Grim on February 12th, 2014, 5:42 pm, edited 2 times in total.
Assuming you are using the AutoScale option on the meter to scale the value, then really no. The space is added automatically when the meter is drawn, and there is no way to suppress it. You would instead need to use the Scale option, and tell it the amount you want to scale the number. Then you can set any text you want on the meter, by using the Text option with %1 for the value returned by MeasureName on the meter. This is going to be quite a bit less flexible than AutoScale, since you will have to make an assumption that the value is always going to be megabytes or gigabytes or whatever works best.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
jsmorley wrote:Assuming you are using the AutoScale option on the meter to scale the value, then really no. The space is added automatically when the meter is drawn, and there is no way to suppress it. You would instead need to use the Scale option, and tell it the amount you want to scale the number. Then you can set any text you want on the meter, by using the Text option with %1 for the value returned by MeasureName on the meter. This is going to be quite a bit less flexible than AutoScale, since you will have to make an assumption that the value is always going to be megabytes or gigabytes or whatever works best.
I am using AutoScale, and damn. 3.1 feature request?
smurfier wrote:Here's the scary math solution.
8< Snip, will play with this and see.
Thanks for the quick responses.
Edit: Took the 'B' out of my Text. Saved some room there.
Perhaps this would be a cool addition to the String measure. Let it behave kind of like a String meter only that it's not displayed. This means let it use AutoScale and %1 etc. to insert values of other measures, then edit the result by Substitute/RegExpSubstitute.
So I found a solution to this that's way simple using a Substitute on the Measure. Substitute=" K":"K"," M":"M"," G":"G"," T":"T"
Full working code example with measures and meters.
The routines for Subsitute and AutoScale are both in the underlying code for measures (Measure.cpp in the C++), but they are "called" by the meters when the value is "used". Just so happens that Substitute is done last. This is a nice trick that also never occurred to me before.
jsmorley wrote:The routines for Subsitute and AutoScale are both in the underlying code for measures (Measure.cpp in the C++), but they are "called" by the meters when the value is "used". Just so happens that Substitute is done last. This is a nice trick that also never occurred to me before.