Skip to main content

Function: applyFieldFormat()

applyFieldFormat(format, value): string

Defined in: components/Field/formats.ts:101

Apply a format's mask to a raw value. Non-digits are stripped first, the shortest pattern that fits is used, and digits past the longest pattern are dropped.

Parameters

ParameterType
format"br.cep" | "br.cpf" | "br.cnpj" | "br.phone"
valuestring

Returns

string