I would like the length (time) column to display as MM:SS.xxx, with three decimal places displayed. I have tried using %length% and functions like div(x,y), but can't seem to get the syntax correct. Any suggestions?

Which field would show you the fractions of a second?

The only ones I found are %_length% and %_length_seconds%.

To get the length out of the last field:

$div(%_length_seconds%,60):$mod(%_length_seconds%,60)

Thanks, ohrenkino. That helped a lot!

Here's what is 'working' so far:

$div($mod(%length%,6000000),60000):$div($mod(%length%,60000),1000).$mod(%length%,1000)

The only problem is that a time of something like 4:03.291 displays as 4:3.291.

Is there a simple way of forcing the zero in 03 seconds?

$div($mod(%length%,6000000),60000):$num($div($mod(%length%,60000),1000),2).$mod(%length%,1000)

or e.g.

$div($mod(%length%,6000000),60000):$num($div($mod(%length%,60000),1000),2).$num($mod(%length%,1000),3)

Very, very nice! Thanks a million!

You may have noticed that I didn't account for track lengths of 1 hour or more.

I doubt that I even have any, so I'm not too worried about it.

Thanks again, and enjoy the rest of the weekend!

This is strange.

I only tested this for mp3 files, and it was fine.

For FLAC files (which is what I use the most), I get all files with a time of 0:00.000.

???

Try

%_length%

instead of

%length%

Thanks for your reply.

When using:

$div($mod(%_length%,6000000),60000):$num($div($mod(%_length%,60000),1000),2).$num($mod(%_length%,1000),3)

I get 0:00.004 for a song that should be 4:03.291.

This result is for both mp3 and FLAC.

Also, if I use %_length_seconds% only, I get the number of seconds rounded to the nearest second. So %_length_seconds% won't give me fractions (decimals) of a second.

That is why I asked

See e.g. the help on variables with technical information:

I think that %length% was a user-defined field, inserted by the converter. An apparently the converter for flac does not add this field.

Yes, I had already been looking at that page you linked to.

I'm wondering if I could use the bit rate somehow. Take the file size (in kB) and divide it by the bit rate (in kB/s), to generate the time in seconds.

I'll have to experiement some more.

Thanks for your input.

I was wondering if there might be something I could add to Options --> Tags --> Mapping that would work for FLAC files to extract the length (time).

Anyone know?