% Generated by roxygen2: do not edit by hand % Please edit documentation in R/normalize.R \name{normalize_cep} \alias{normalize_cep} \title{Return the 8 digits of a CEP, accepting the mask} \usage{ normalize_cep(value) } \arguments{ \item{value}{A length-one character vector. Numbers are rejected on purpose: \code{1001000} has already lost the leading zero that makes \code{"01001000"} a CEP. Convert with \code{sprintf("\%08d", x)} first.} } \value{ The 8 digits, as a length-one character vector. } \description{ \code{"01001-000"}, \code{"01001000"}, \code{"01001.000"} and \code{" 01001-000 "} all become \code{"01001000"}. This runs \strong{before} any request: a 7-digit CEP is the caller's bug, and spending a round trip for the server to say so wastes both sides' time. } \section{Conditions}{ Signals \link[=cepis_conditions]{cepis_invalid_cep} unless exactly 8 digits remain. } \examples{ normalize_cep("01001-000") }