I have found a javascript on phoneformat.com. It works fine for all American phone numbers as well as international phone numbers.
I need to modify it so that it also handles Swedish local phone numbers as that is my market.
/Peder
## Deliverables
Basically it is about:
1. taking js file from [login to view URL]
2. Add so that it also handles all cases where phone numbers start with any of the prefixes noted here: [[login to view URL]
3][1]. If the phone number after any of those prefixes has:
- 5 digits it shall be formatted {prefix}-XXX XX
- 6 digits it shall be formatted {prefix}-XX XX XX
- 7 digits it shall be formatted {prefix}-XXX XX XX
- 8 digits it shall be formatted {prefix}-XXX XXX XX
4. There is one exception. phoneformat already has a case for "011" . We keep existing js rule for 10 chars and more. For 9 chars and less we use our case above for prefix + 6 digit phone number.