Convert bitrate to integer

Discuss using and your tips/tricks for CATraxx
Post Reply
ckoiner
Posts: 2
Joined: Mon Jul 17, 2017 3:26 pm

Convert bitrate to integer

Post by ckoiner » Mon Jul 17, 2017 3:33 pm

Years ago, I requested and received a way to add a bitrate field to my html export.

<xsl:value-of select="sum(../trackdata/disc/side/track/audiosample/bitrate) div (count(../trackdata /disc/side/track/audiosample[bitrate>0]))"/>

In my previous html exports, the bitrate has shown up as an integer (example www.myalbumcollection.com).

I recently updated to the newest version of CATraxx, and when I use the same code, the bitrate field lists decimal places, not just an integer.

Can anyone give me any help in correcting or updating the code so that reports the bitrate field as an integer? Many thanks!

User avatar
LotsOCds
Posts: 177
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Convert bitrate to integer

Post by LotsOCds » Tue Jul 18, 2017 1:43 pm

I am far away from my CATraxx computer so I can't test it, however this should work:

Code: Select all

<xsl:value-of select="round(sum(../trackdata/disc/side/track/audiosample/bitrate) div (count(../trackdata /disc/side/track/audiosample[bitrate>0])))"/>
Cheers,
Dave

ckoiner
Posts: 2
Joined: Mon Jul 17, 2017 3:26 pm

Re: Convert bitrate to integer

Post by ckoiner » Wed Jul 19, 2017 4:10 am

Worked great! Thank you so much!

Post Reply