# Decimal points - can you control them

**URL:** https://community.mp3tag.de/t/decimal-points-can-you-control-them/13532
**Category:** Support
**Created:** [June 10, 2012, 5:51am UTC](https://community.mp3tag.de/t/decimal-points-can-you-control-them/13532 "2012-06-10T05:51:51Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 10, 2012, 6:16am UTC](https://community.mp3tag.de/t/decimal-points-can-you-control-them/13532/2 "2012-06-10T06:16:20Z")

</div>

> [@pomozki](#):
>
> Hi, one of the MP3 tags I work with is BPM - by default this often has 2 digits after the decimal point but this causes me problems  
> can MP3tag allow you to control decimal points, just as you can when dealing with numerical fields in Excel - so you can have 0,1 or 2? much appreciated if someone can tell me thanks

Use the Mp3tag scripting functions to manipulate the BPM string value.

See also ...  
[/t/7887/1](https://community.mp3tag.de/t/7887/1)  
[/t/7075/1](https://community.mp3tag.de/t/7075/1)  
[/t/6066/1](https://community.mp3tag.de/t/6066/1)  
[/t/7295/1](https://community.mp3tag.de/t/7295/1)

Begin Action Group **MyMusic#19 Round BPM to integer** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM\_MIXMEISTER**  
_Formatstring:_ **$if2(%BPM\_MIXMEISTER%,%BPM%)**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM\_ROUNDBY**  
_Formatstring:_ **1**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$div($mul($mul(%BPM\_ROUNDBY%,100),$ifgreater($sub($div($mul($left($replace(%BPM%,.,)00,$add($len($div(%BPM%,1)),2)),10),$mul(%BPM\_ROUNDBY%,100)),$mul($div($left($replace(%BPM%,.,)00,$add($len($div(%BPM%,1)),2)),$mul(%BPM\_ROUNDBY%,100)),10)),4,$add($div($left($replace(%BPM%,.,)00,$add($len($div(%BPM%,1)),2)),$mul(%BPM\_ROUNDBY%,100)),1),$div($left($replace(%BPM%,.,)00,$add($len($div(%BPM%,1)),2)),$mul(%BPM\_ROUNDBY%,100)))),100)**

 

Action #4  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **BPM\_ROUNDBY**

 

End Action Group **MyMusic#19 Round BPM to integer** (4 Actions)

 Begin Action Group **Test\_2011#20111129.BPM.Runden.NK0** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$replace(%BPM\_MIXMEISTER%,'.',%DUMMY%)**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$div(%BPM%,10)**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$ifgreater($mod(%BPM%,10),4,$add($div(%BPM%,10),1),$div(%BPM%,10))**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$if($eql(%BPM%,'0'),%DUMMY%,%BPM%)**

 

End Action Group **Test\_2011#20111129.BPM.Runden.NK0** (4 Actions)

 Begin Action Group **Test\_2011#20111129.BPM.Runden.NK1** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$replace(%BPM\_MIXMEISTER%,'.',%DUMMY%)**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$ifgreater($mod(%BPM%,10),4,$add($div(%BPM%,10),1),$div(%BPM%,10))**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$div(%BPM%,10)'.'$mod(%BPM%,10)**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **BPM**  
_Formatstring:_ **$if($eql(%BPM%,'0.0'),%DUMMY%,%BPM%)**

 

End Action Group **Test\_2011#20111129.BPM.Runden.NK1** (4 Actions)

 

If you only want to change the displayed value in the list view, without changing the BPM tag-field, then apply the fitting scripting function to the field 'Value' in the specific column dialog.

 

DD.20120610.1034.CEST

---

_[View the full topic](https://community.mp3tag.de/t/decimal-points-can-you-control-them/13532)._
