Text Direction in Phaser.js

Since I can't find any documentation on the phaser to make this happen then i simply just make a work around to look like i am able to make the direction of the text to be right align.

Here is a simple text

var txt = this.game.add.text(10, 10, '0', {
    font: "21px arial", 
    fill: "#00FF00", 
    align:'right', 
    fontWeight:'bold',
});

compute for the new position x of the txt

formula :

txt.x = contant - txt.width

the constant will be a reference point you want to offset according to your positioning

so when the variable txt text updated

then you can re-position it again using the the new data

txt.setText(100);

txt.x = 84 - (txt.width);