summaryrefslogtreecommitdiffstats
path: root/man/normalize_cep.Rd
diff options
context:
space:
mode:
Diffstat (limited to 'man/normalize_cep.Rd')
-rw-r--r--man/normalize_cep.Rd33
1 files changed, 33 insertions, 0 deletions
diff --git a/man/normalize_cep.Rd b/man/normalize_cep.Rd
new file mode 100644
index 0000000..6f9b462
--- /dev/null
+++ b/man/normalize_cep.Rd
@@ -0,0 +1,33 @@
+% 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")
+
+}