Skip to content

A useful tool for formatting phone numbers with the correct prefix by given country code

License

Notifications You must be signed in to change notification settings

DanRaiss/WorldTelephoneFormatterJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

WorldTelephoneFormatterJS

A useful tool for formatting phone numbers with the correct prefix by given country code in Javascript (Vanilla)

Containing 252 world states prefixes!

Instalation Paste code inside your project folder, include it inside header or just in any class.

Use : let countryCode = "CZ"; let telephoneToFormat = "225321486"

let telephoneFormatted = TelephoneFormatter.normalize(telephoneToFormat, countryCode);

OUTPUT: +420 225 321 486

Important! If you want to change spacing between numbers, change it in makeSpaces() there is a number 3, for making spaces after 3 chars.

Any contribution is welcomed! :)

About

A useful tool for formatting phone numbers with the correct prefix by given country code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published