Closed vault-developer closed 3 years ago
Hi The digit "0" was the trunk code. For getNationalNumber() it will only give you national number i.e- 212345678. If you want to add 0 you can use getItalianLeadingZero() fxn & if it's give true you can concate 0 at at begining of national number. Thanks
Hello, @NagendraSIB Oh, I see now. Thank you for the explanation.
Hello! Thank you for your library, it's great!
I tried to retrieve an example number for Italy. Looks like all is correct in
metadata.js
: https://github.com/ruimarinho/google-libphonenumber/blob/master/src/metadata.js#L3721 Please pay attention to the end of the line, number is0212345678
.But then when I try to retrieve this number like this:
PhoneNumberUtil.getInstance().getExampleNumber('IT').getNationalNumber();
I receive only212345678
(first 0 is omitted).P.S. Probably it is happened because of casting string to number here: https://github.com/ruimarinho/google-libphonenumber/blob/master/src/phonenumberutil.js#L4313
Thank you in advance!