phone icon indicating copy to clipboard operation
phone copied to clipboard

[doubt] Why do we need to set the default_country_code to use the format?

Open AllanKlaus opened this issue 5 years ago • 0 comments

I'm using Phoner::Phone.parse(phone_number).format(:us). I didn't set the default_country_code so I got the error Phoner::CountryCodeError (Must enter country code or set default country code).

I already saw on method parse we have a Country.load but why do I need to set the contry code if I only want to format the phone number? There is a reason for it?

AllanKlaus avatar Jun 29 '20 15:06 AllanKlaus