# Rundung auf 20er Schritte im Tag BMP

**URL:** https://community.mp3tag.de/t/rundung-auf-20er-schritte-im-tag-bmp/7075
**Category:** Allgemein
**Created:** [July 24, 2008, 5:44pm UTC](https://community.mp3tag.de/t/rundung-auf-20er-schritte-im-tag-bmp/7075 "2008-07-24T17:44:11Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [July 26, 2008, 12:03pm UTC](https://community.mp3tag.de/t/rundung-auf-20er-schritte-im-tag-bmp/7075/4 "2008-07-26T12:03:11Z")

</div>

Runden von BPM Werten mit bis zu 2 Dezimalstellen auf ganze Zahlen mit Rundungsschrittweite BPM\_ROUNDBY = n (mit n als Element von N+):

```
$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)

```

Beispiele:  
BPM=149.99 und ROUNDBY=1 ergibt BPM=150.  
BPM=149.99 und ROUNDBY=2 ergibt BPM=150.  
BPM=149.99 und ROUNDBY=3 ergibt BPM=150.  
BPM=149.99 und ROUNDBY=4 ergibt BPM=148.  
BPM=149.99 und ROUNDBY=5 ergibt BPM=150.  
BPM=149.99 und ROUNDBY=6 ergibt BPM=150.  
BPM=149.99 und ROUNDBY=7 ergibt BPM=147.  
BPM=149.99 und ROUNDBY=8 ergibt BPM=152.  
BPM=149.99 und ROUNDBY=9 ergibt BPM=153.  
BPM=149.99 und ROUNDBY=10 ergibt BPM=150.  
BPM=149.99 und ROUNDBY=20 ergibt BPM=140.  
BPM=149.99 und ROUNDBY=40 ergibt BPM=160.  
BPM=149.99 und ROUNDBY=100 ergibt BPM=100.

Anfang Aktionengruppe **Round BPM to integer**

Aktion #1  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_MIXMEISTER**  
_Formatstring:_ **$if2(%BPM\_MIXMEISTER%,%BPM%)**

Aktion #2  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_ROUNDBY**  
_Formatstring:_ **1**

Aktion #3  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_A**  
_Formatstring:_ **$mul(%BPM\_ROUNDBY%,100)**

Aktion #4  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_B**  
_Formatstring:_ **$left($replace(%BPM%,.,)00,$add($len($div(%BPM%,1)),2))**

Aktion #5  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_C**  
_Formatstring:_ **$div($mul(%BPM\_B%,10),%BPM\_A%)**

Aktion #6  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_D**  
_Formatstring:_ **$div(%BPM\_B%,%BPM\_A%)**

Aktion #7  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_E**  
_Formatstring:_ **$mul(%BPM\_D%,10)**

Aktion #8  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_F**  
_Formatstring:_ **$ifgreater($sub(%BPM\_C%,%BPM\_E%),4,$add(%BPM\_D%,1),%BPM\_D%)**

Aktion #9  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM**  
_Formatstring:_ **$div($mul(%BPM\_A%,%BPM\_F%),100)**

Aktion #10  
_Aktionstyp 9:_ **Tagfelder entfernen**  
_Folgende Tagfelder entfernen (mit Semikolon getrennt):_ **BPM\_A;BPM\_B;BPM\_C;BPM\_D;BPM\_E;BPM\_F;BPM\_ROUNDBY**

Ende Aktionengruppe **Round BPM to integer** (10 Aktionen)

oder

Anfang Aktionengruppe **Round BPM to integer**

Aktion #1  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_MIXMEISTER**  
_Formatstring:_ **$if2(%BPM\_MIXMEISTER%,%BPM%)**

Aktion #2  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **BPM\_ROUNDBY**  
_Formatstring:_ **1**

Aktion #3  
_Aktionstyp 5:_ **Tagfeld formatieren**  
_Feld:_ **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)**

Ende Aktionengruppe **Round BPM to integer** (3 Aktionen)

DD.20080726.1602.CEST

Aktion angepasst für BPM Werte mit bis zu 2 Dezimalstellen.

DD.20080728.1152

---

_[View the full topic](https://community.mp3tag.de/t/rundung-auf-20er-schritte-im-tag-bmp/7075)._
