# Function to multiply BPM x 2

First of all, congratulations for your excellent program!

I've built a function:

\$mul(%bpm%,2)

to double the number in the BPM field, since some songs are wrongly calculated by MixMeister BPM Analyzer. The problem is the decimals. MixMeister writes numbers with two decimals (e.g. 90.99) and when this function multiplies it by two the result is 180, and not 181.98. Is there a way to solve this? I want to keep 2 decimals if possible.

/t/7295/1

Thanks a lot!!! . I han't seen it and sorry for that.

Mp3tag supports only integer math, so you have to find a way to convert a float resp. decimal value into its integer parts, do the math, and reconvert the integer parts into a decimal value.
Because the BPM value is available as a string in the ID3 field TBPM, you can use the Mp3tag scripting language.

Action: Format value
Field: BPM
Formatstring:

\$div(\$mul(\$replace(%BPM%,'.',),2),100)'.'\$mod(\$mul(\$replace(%BPM%,'.',),2),100)

From:
90.99
To:
181.98

There are some threads about BPM ...
https://community.mp3tag.de/search?q=BPM

DD.20110805.0828.CEST