It is currently February 4th, 2023, 3:31 am

How to add decimal places back after min calculation

Get help with creating, editing & fixing problems with skins
hnr1k
Posts: 2
Joined: January 19th, 2023, 2:28 am

How to add decimal places back after min calculation

Post by hnr1k »

Hello,

I've been fiddling with this for an hour now and am just not sure how to add the decimal places to the Min calculation.

The value comes in from HWInfo. It is formatted like so 12.000.

When I do the MIN calculation, the decimal places disappear. I have tried adding NumOfDecimals=3 to both the min calculation and the meter.

The line of the meter currently shows: "VOLT: 12.079 V - MIN: 12 V"

If anyone has a suggestion, I'd greatly appreciate it.

Code: Select all

[MeasureGPUInputVolt]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw8
OnChangeAction=[!SetOption MeasureGPUInputVoltMIN Formula "(Min(MeasureGPUInputVolt,MeasureGPUInputVoltMIN))"]

[MeasureGPUInputVoltMIN]
Measure=Calc
Formula=( Min ( MeasureGPUInputVolt, 13.000 ))

[meterGPUInputVolt]
Meter=String
MeterStyle=styleText
MeasureName=MeasureGPUInputVolt
MeasureName2=MeasureGPUInputVoltMIN
Text="VOLT: %1 V - MIN: %2 V"
DynamicVariables=1
X=10
Y=5R
User avatar
balala
Rainmeter Sage
Posts: 14935
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to add decimal places back after min calculation

Post by balala »

hnr1k wrote: January 19th, 2023, 2:34 am When I do the MIN calculation, the decimal places disappear. I have tried adding NumOfDecimals=3 to both the min calculation and the meter.
Adding the NumOfDecimals=3 option to the String meter which shows the value (in this case [meterGPUInputVolt]) should do the job, especially that in this case the measure which returns the value which should have the specified number of decimals ([MeasureGPUInputVoltMIN]) is a Calc measure.
Isn't it working with this option?
hnr1k
Posts: 2
Joined: January 19th, 2023, 2:28 am

Re: How to add decimal places back after min calculation

Post by hnr1k »

OMG. Thank you so much!
It's working now. Not sure what I did wrong yesterday...

"VOLT: 12.111 V - MIN: 12.049 V"

Code: Select all

[meterGPUInputVolt]
Meter=String
MeterStyle=styleText
MeasureName=MeasureGPUInputVolt
MeasureName2=MeasureGPUInputVoltMIN
Text="VOLT: %1 V - MIN: %2 V"
DynamicVariables=1
NumOfDecimals=3
X=10
Y=5R
User avatar
balala
Rainmeter Sage
Posts: 14935
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to add decimal places back after min calculation

Post by balala »

hnr1k wrote: January 19th, 2023, 5:20 pm It's working now.
:thumbup: Glad you got it working as expected. :thumbup:
hnr1k wrote: January 19th, 2023, 5:20 pm Not sure what I did wrong yesterday...
I assume you've added the option to the [MeasureGPUInputVoltMIN] measure, but haven't try to add to the [meterGPUInputVolt] meter as well (even if you think you've tried).