I guess I can provide you some hints of code. Its not tested and you need to be doing it yourself.

LDA X // Load from the memory location X
DAA   // Decimal adjust it to BCD
STA Y //Store the result into the Location Y.
Can you explain what you meant by 3 consecutive memory locations.