Just in case any of you are working to format phone numbers on the order printer templates, I found some liquid code that works quite well from another user on the forums (Sorry I couldn't find the post to give credit to the original poster).
We wanted to be able to print the phone number as XXX-XXX-XXXX . Problem is some customers include the dashes when they enter their phone numbers, and some don't. So the code I found worked fine if the customer had not entered dashes themselves. But if they had, the phone number print became unreadable.
So here's the code with my modification. It's quite easy actually. I simply remove all of the "-"s before formatting the number. So it handles either case just fine .
The liquid code is:
Billing Phone Number: {% assign phone = billing_address.phone | remove: "-" | split: '' %}{{ phone[0] }}{{ phone[1] }}{{ phone[2] }}-{{ phone[3] }}{{ phone[4] }}{{ phone[5] }}-{{ phone[6] }}{{ phone[7] }}{{ phone[8] }}{{ phone[9] }}
This would be easily adaptible for other countries by checking the country information and creating a slightly different version for other countries if you need to do that.
Hope this helps someone else.
Gordon