This is due to the nature of Lua as it is a dynamically typed language, which is why something like this will work:
Code: Select all
local ret = string.format("%02d", 1)
ret = ret + 1
return ret -- returns 2
Prior to r885, Rainmeter 'requested' a textual value and
a numerical value. This, however, rendered NumOfDecimals, Scale, AutoScale, and Percentual useless when using MeasureName=ScriptMeasure on STRING meters as Rainmeter simply used whatever textual value Lua gave.
r855 and later request a numerical value first and, if it is not available, request a textual value. Because "02" and 2 are analogous in Lua, they both return true in the 'get numerical value' stage.
Fixing this would require reverting the pre-r885 behavior and thus break NumOfDecimals, Scale, etc. I will discuss this matter with the other devs.