It is currently May 19th, 2024, 6:17 pm

Uptime Question (need help again)

Get help with creating, editing & fixing problems with skins
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Uptime Question (need help again)

Post by poiru »

Wolfgang DelaSangre wrote:Yeah, I just restarted the computer and figured that out. Can't figure out for the life of me how to get that comma to change to an " and "if the percents don't matter, though.
Why don't you just change it in the Format= line? And I assume my newer solution works properly?
Wolfgang DelaSangre
Posts: 35
Joined: December 14th, 2010, 6:11 am

Re: Uptime Question (need help again)

Post by Wolfgang DelaSangre »

Actually, now I think about it, that solution might work, assuming Rainmeter is as fluid as I hope it is (no pun intended).

Also, I don't want to change it for aesthetic reasons. And grammar.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Uptime Question (need help again)

Post by poiru »

Wolfgang DelaSangre wrote:Also, I don't want to change it for aesthetic reasons. And grammar.
Ah, I see what you're trying to do now. Didn't realize you wanted it to change between a comma and "and" depending on the time.. This should do it:

Code: Select all

[MeasureUpTime]
Measure=UpTime
Format=".%4!i! days, .%3!i! hours and -.%2!i! minutes"
Substitute=".0 days, ":"",".1 days":"1 day",".0 hours and ":"",".1 hours":"1 hour",", -":" and ","-":""," and .0 minutes":"",".1 minutes":"1 minute",".":""
Here are a few examples I tried:

Code: Select all

00:00:00 -> 0 minutes
00:00:01 -> 1 minute
00:02:00 -> 2 hours
03:00:00 -> 3 days
01:00:01 -> 1 day and 1 minute
01:02:01 -> 1 day, 2 hours and 1 minute
00:03:02 -> 3 hours and 2 minutes
I think that should cover all bases.
Wolfgang DelaSangre
Posts: 35
Joined: December 14th, 2010, 6:11 am

Re: Uptime Question (need help again)

Post by Wolfgang DelaSangre »

Well, I could actually get it to show me "X days and X minutes". What I couldn't get it to do was show me "X days and X hours".

Only solution I could come up with was to simply cover all 23 bases for hours.

", .1 hour and .0 minutes":" and .1 hour"

I did that, but moving all the way up to ".23 hours". No problems so far, but I'll have to wait at least one more day before I can figure out if it works properly or not.