It is currently May 4th, 2024, 6:11 pm

thousands separator

Get help with creating, editing & fixing problems with skins
User avatar
Indy
Posts: 40
Joined: August 8th, 2013, 10:40 pm

Re: thousands separator

Post by Indy »

Here the Skin, but dont grumble to much whit me for the first Project whit Rainmeter :oops:
Skillview_0.1.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: thousands separator

Post by jsmorley »

The problem(s) are in one of the other lua scripts you are using, specifically countdown3.lua. That seems to have been written a long time ago, and although it will work, the PROPERTIES table and the use of GetStringValue() as a function to "return" values to the skin are deprecated and will cause warnings. They are actually not in any fatal errors, just not recommended.

If you move the "return" function inside of the Update() function like this:

Code: Select all

function Update()

	return GetTimeLeft()

end
and just get rid of the GetStringValue() function entirely, that takes care of that.

As to the PROPERTIES table you are using, that is ok, as it isn't actually being used in the original sense of PROPERTIES in the Rainmeter/Lua implementation, but can and should just be moved inside the Initialize() function.

Code: Select all

function Initialize()

	PROPERTIES = {year=0, month=0, day=0, hour=0, min=0, sec=0, fintext=""}
	RELEASEDATE = {}
	setmetatable(RELEASEDATE, getmetatable(PROPERTIES))
	for k,v in pairs(PROPERTIES) do
		if k ~= fintext then
			RELEASEDATE[k] = v
		end
	end
	RELEASEDATE.isdst = true

	RELEASETEXT = PROPERTIES.fintext or ""

end
I think you might want to rename it from PROPERTIES to something else as well, as you might still get the warning in the log if you use the name "PROPERTIES" as the name of a table anywhere in the Lua.
User avatar
Niemil
Posts: 218
Joined: August 5th, 2014, 5:04 pm
Location: Luleå, Sweden

Re: thousands separator

Post by Niemil »

This is great! :D this morning I've been changing my skins so it got this thousands seperator on WebParsings.
However, now it comes to the skins where I made calculations with other parsing and with numbers, using the calc measure.

This is how the code part looks for example:

Code: Select all

[MeasureHoursLeft]
Measure=Calc
Formula=(MeasurePointsLeft/MeasurePPH)
DynamicVariables=1
OnUpdateAction=[!CommandMeasure MeasureFormatNumber "FormatNumber('HoursLeft', '[MeasureHoursLeft]', '#Separator#', '#Decimal#')"]
The output of this all makes a comma with more numbers than before.
I wanna have whole numbers only. Tried look for some option in calc measure ( http://docs.rainmeter.net/manual/measures/calc ) to just not make decimals but can't see any.
Must been with this Lua code that it made exact calculation. If it's possible to delete the decimals totally? I wont need it for any of the skins I'm using in the current skin package I'm working with :)