Getting a Whole Number Value from %_bitrate%?

Tags: #<Tag:0x00007f00c0ab2a30> #<Tag:0x00007f00c0ab2508>

I’m trying to figure out how to get a whole value from `%_bitrate%.

,$set(_bitRateValue,$left(%_bitrate%,3))) seems to work except I’m not convinced what happens the value of bitrate is less than three places left of the decimal.

…and when the bitrate is a 4 place value… you’re losing the thousandth position.

When I’ve tried ,$set(_bitRateValue,$left(%_bitrate%,4))) I sometimes get a decimal point which doesn’t work with $lt,lte,gt,gte etc. at all, and using ,3 of course will give me 140 for something that was 1400… so if the bitrate is showing higher than 999 I get bogus values to compare against.

$if($eq(%_bitRateType%,VBR)$set(_fileVBRRate,%_vbrRateValue%) ,

You can replace everything starting from the decimal separator to the end of the string with nothing using the rreplace function:


(Unfortunately, the mul and div functions restrict their arguments to integers, see PICARD-1713, so you can’t do $div($mul(%_bitrate%,100000),100000)).


Perfect. Now to completely figure out maths actions.

Perhaps I should look at those sort of like RPN.

$if($gt(%_theValue%,xxx) … do whatever next.

I -really- need to get regex nailed down too. It’s total voodoo to me… but doesn’t have to be.