I am experiencing wrong formatting for French numbers when using the National formatting option.
I have quite a convoluted code (for reasons beyond this issue) which may be the cause, but all other numbers I tried (ES and US) format correctly, so I wonder if this is happening to other people or is a known bug?
import { format, AsYouType } from 'libphonenumber-js';
function formatValue(value, country) {
const formatter = new AsYouType(country);
formatter.input(value);
const formattedValue = (new AsYouType(country)).input(formatter.getNationalNumber());
console.log(formattedValue);
}
formatValue('+33624322683', 'FR');
// > 624322666
// should be '06 24 32 26 66'
I am experiencing wrong formatting for French numbers when using the
National
formatting option.I have quite a convoluted code (for reasons beyond this issue) which may be the cause, but all other numbers I tried (ES and US) format correctly, so I wonder if this is happening to other people or is a known bug?