Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Add Leading zeros

Place your requests for plugins here

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
fishthecat
LCD Smartie Fanatic
Posts: 132
Joined: March 9th, 2005, 2:21 pm
Location: UK

Add Leading zeros

Post by fishthecat »

I'm using $WinampPosh. Then you are a few seconds into a mp3, it looks like this: 19
I want it to look like this: 0:19
Is there a way I can add the leading 0: on until the time reaches 1:00? Or do I need a plugin?

limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

I'm afraid you need a plugin...
I can't recall the post right now but some user had the same problem and using the regular expression plugin didn't help.
athe whole deal is:
We need a good formatting plugin for winamp times. :?

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

You can do this with regular expressions, as Reverse Engineer and I posted here

It's rather bewildering to the uninitiated, but download regexp.dll and try a copy/paste from the posts.

I have it set up so that when $WinampPosh returns something like "34" (34 seconds), the regexp function returns "0:34" in the conventional time format.

Matt.

fishthecat
LCD Smartie Fanatic
Posts: 132
Joined: March 9th, 2005, 2:21 pm
Location: UK

Post by fishthecat »

mattcro wrote:You can do this with regular expressions, as Reverse Engineer and I posted here

It's rather bewildering to the uninitiated, but download regexp.dll and try a copy/paste from the posts.

I have it set up so that when $WinampPosh returns something like "34" (34 seconds), the regexp function returns "0:34" in the conventional time format.

Matt.
That's Perfect. One can do almost anything with regular expressions.

To finish off this thread here's the answer to the question I asked at the top.
To get leading zeros, you need the regexp.dll plugin and the following code. It works like a charm.

Code: Select all

$dll(regexp,3,0:(\d*):#\1:#:(\d)#:0\1#0(\d\d)#\1,0:$WinampPosh)

Post Reply