fix: format plain french numbers with dot grouping
This commit is contained in:
@@ -58,10 +58,6 @@ export const formatPhone = (rawValue: string | null | undefined): string => {
|
|||||||
return ['+33', ...groups].join('.')
|
return ['+33', ...groups].join('.')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^0\d{9}$/.test(normalized)) {
|
|
||||||
return normalized
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasInternationalPrefix = normalized.startsWith('+')
|
const hasInternationalPrefix = normalized.startsWith('+')
|
||||||
const prefix = hasInternationalPrefix ? normalized.slice(0, 1) : ''
|
const prefix = hasInternationalPrefix ? normalized.slice(0, 1) : ''
|
||||||
const digits = hasInternationalPrefix ? normalized.slice(1) : normalized
|
const digits = hasInternationalPrefix ? normalized.slice(1) : normalized
|
||||||
|
|||||||
Reference in New Issue
Block a user