So since this is in JS, and ESC/POS accepts spaces on an empty quote like this, " ", I then focused on doing a loop that creates spaces depending of the width of the paper minus the length of your placeholder string plus the length of the price. The width can be determined by the number of "." dots that fits on the paper. You can do this ...
If POS accepting direct ESC codes, then you can form control string and data using for example PowerShell
You can form your string as standard ESC sequence, where "0x1B" will be represented as special character and it looks like
where The `e is the escape character and [ is the introduction to ESC sequence.
so you can form your string as:
I don't know your printer, but in general alignment codes pertain to
the whole line.
it was said about one such printer:
The command is enabled only when processed at the beginning of the line in standard mode.
says for "ESC a":
Aligns all data in one line to the specified position.