Old Testament readings use the Septuagint , the Scripture the apostles quoted. Masoretic numbering shown for reference.Learn why
KJV

2 Samuel 22:24

I was also upright before him, and have kept myself from mine iniquity.

Read in other translations