Every country has different phone number length and therefore different format. In my country its:
XXX XXX XXX (9 digits) for mobile
(AA) XXX XX XX (AA = area code) for landline
Dialer displays it like that, which looks weird:
all of the phones display it correctly:
There are for sure ready libraries for such things.