Code: Select all
[MS_X]
Measure=Calc
Formula=(1/(10**6))
;Formula=0.000001
DynamicVariables=1
Code: Select all
[MS_X]
Measure=Calc
Formula=(1/(10**6))
;Formula=0.000001
DynamicVariables=1
Code: Select all
[Rainmeter]
Update=-1
[MeasureNum]
Measure=Calc
Formula=( MeasureNum + 1 )
[MS_X]
Measure=Calc
Formula=(1/(10**[MeasureNum]))
;Formula=0.000001
DynamicVariables=1
[MeterOpenStart]
Meter=STRING
MeasureName=MS_X
MeasureName2=MeasureNum
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%2#CRLF#%1
NumOfDecimals=[MeasureNum]
DynamicVariables=1
LeftMouseUpAction=[!UpdateMeasure "MeasureNum"][!UpdateMEasure "MS_X"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
Well, it doesn't help how many decimals you can have in a string meter anyway, since a string meter of a number uses the number itself as a base. So, when Rainmeter is turning the number 0.000001 into 0, you can have, say 6 decimals in the string meter all you like, that string would still be 0.000000 instead of 0.000001 - correct me if I'm wrong...
I think you are. If you set the NumOfDecimals option on the String meter to 6, you'll get 0.000001, not 0.000000. However if there is no NumOfDecimals option on the String meter, the default NumOfDecimals=0 is used, rounding the number to the nearest integer.Yincognito wrote: ↑December 22nd, 2018, 6:26 pm Well, it doesn't help how many decimals you can have in a string meter anyway, since a string meter of a number uses the number itself as a base. So, when Rainmeter is turning the number 0.000001 into 0, you can have, say 6 decimals in the string meter all you like, that string would still be 0.000000 instead of 0.000001 - correct me if I'm wrong...
I don't want to post the actual code yet, as it is intended to be posted in Tips & Tricks section once it works as expected. I can replicate the behavior based on your example though:
Code: Select all
[Rainmeter]
Update=-1
[MeasureNum]
Measure=Calc
Formula=( MeasureNum + 1 )
[MS_X]
Measure=Calc
Formula=(1/(10**[MeasureNum]))
;Formula=0.000001
DynamicVariables=1
[MS_Y]
Measure=String
String=[MS_X:],[MS_X]
RegExpSubstitute=1
Substitute="^(.*)$":"Value is eventually lost: \1"
DynamicVariables=1
[MeterOpenStart]
Meter=STRING
MeasureName=MS_X
MeasureName2=MeasureNum
MeasureName3=MS_Y
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%2#CRLF#%1#CRLF#%3
NumOfDecimals=[MeasureNum]
DynamicVariables=1
LeftMouseUpAction=[!UpdateMeasure "MeasureNum"][!UpdateMEasure "MS_X"][!UpdateMeasure "MS_Y"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
Yep, that's what I was talking about ... sort of. I use the [MS_X] style for demonstration purposes in my skin, to display both the number and the string value of my result. It makes sense, in my case, since the result must be available in tooltips, where the MeasureName option is limited to, among others, NumOfDecimals=0, according to the manual.balala wrote: ↑December 22nd, 2018, 8:11 pm It seems a String meter shows the numeric value with the set number of decimals ONLY if it is set through a MeasureName option. If you set it through a Text=[MS_X] option, just up to six decimals can be shown.
Interesting. Didn't know about this limitation.
Good to be known, however.
No more comments, from my part, just that I didn't know about this limitation.Yincognito wrote: ↑December 22nd, 2018, 8:36 pm Yep, that's what I was talking about ... sort of. I use the [MS_X] style for demonstration purposes in my skin, to display both the number and the string value of my result. It makes sense, in my case, since the result must be available in tooltips, where the MeasureName option is limited to, among others, NumOfDecimals=0, according to the manual.
For the record, I'm working on AutoScale / Scale in tooltips. I used the code for years with no issues, but now I thought about sharing it with the community. What I want to achieve - and why I needed to tweak my already working code, instead of simply posting it as it was - is to make the skin use close to 0 hardcoded values, playing only with a few variables.
Anyway, I now use a workaround for the decimals issue in the measure, but I'm still limited by the 5 max decimals if I set the scale to higher values...
balala wrote: ↑December 22nd, 2018, 8:11 pm It seems a String meter shows the numeric value with the set number of decimals ONLY if it is set through a MeasureName option. If you set it through a Text=[MS_X] option, just up to six decimals can be shown.
Interesting. Didn't know about this limitation.
Good to be known, however.
[SomeMeasure] is not some magic value, it's a Section variable which is string, and strings don't have any precision.Yincognito wrote: ↑December 22nd, 2018, 8:36 pm Anyway, I now use a workaround for the decimals issue in the measure, but I'm still limited by the 5 max decimals (4 in my case, since the 5th is used in the regex substitute), as it breaks the whole output if I set my #Decimals# variable to 5 or higher...
Have I said it's something magic?rxtd wrote: ↑December 23rd, 2018, 8:23 am [SomeMeasure] is not some magic value, it's a Section variable