blob: 6f9b46211fb1b317275d60835ac65730c1673037 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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")
}
|