It is currently December 1st, 2020, 6:30 pm

Substitute Is Treating 10(Ten) as 1 0 (One Zero)

Help with creating, editing & fixing problems with skins
zseeman
Posts: 2
Joined: April 6th, 2010, 4:09 am

Substitute Is Treating 10(Ten) as 1 0 (One Zero)

Substitute Is Treating 11(Eleven) as 1 1 (One One) too, in fact all digits larger than nine in the following calculation end up being treated as two instances of single digits.

Code: Select all

``````[MeasureHour]
Measure=Time
Format="%H"

[MeasureAfternoon]
Measure=Calc
Formula= (MeasureHour > 11) ? (MeasureHour-12) : 12
Substitute= "12":"in the morning","0":"in the afternoon","1":"in the afternoon","2":"in the afternoon","3":"in the afternoon","4":"in the afternoon","5":"in the afternoon","6":"in the evening","7":"in the evening","8":"in the evening","9":"at night","10":"at night","11":"at night"
``````
I've tried some manipulation on MeasureHour, but I don't know if there's a way if %H>21 to set MeasureHour to 21- since everything after 9 and after is "at night".

Also, is there a chance that Rainmeter has a boolean and that I could use in the formula line?
I can't seem to find a dictionary of keywords & operators for Rainmeter, if I could get pointed in that direction I would be very happy.
Alex2539
Rainmeter Sage
Posts: 648
Joined: July 19th, 2009, 5:59 am

Re: Substitute Is Treating 10(Ten) as 1 0 (One Zero)

Change the order. Put the substitutions for "10" and "11" before those for "1" and "0" and it will be fine. When it looks for things to substitute, it does it all in order.
zseeman
Posts: 2
Joined: April 6th, 2010, 4:09 am

Re: Substitute Is Treating 10(Ten) as 1 0 (One Zero)

Thank you, that's certainly a much simpler solution than I was expecting!

Is there anywhere you could point me so I could learn more about the language for Rainmeter.
Falconer
Posts: 126
Joined: August 12th, 2009, 4:10 pm
Location: Behind you!

Re: Substitute Is Treating 10(Ten) as 1 0 (One Zero)

The almighty Manual

^^If you haven't been there yet, it's a good place to start.
jsmorley
Developer
Posts: 21563
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Substitute Is Treating 10(Ten) as 1 0 (One Zero)

Even better, start here:

http://rainmeter.net/cms/Support

The manual is one resource, we have others.