export const addParensToFormatAreaCode = (phone?: string) => { const phoneParts = phone?.split("-"); if (phoneParts !== undefined && phoneParts[0] !== "") { const phoneJoin: string = `(${phoneParts[0]}) ${phoneParts[1]}-${phoneParts[2]}`; return phoneJoin; } return strings.DEFAULT; };
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter