stdnum.do.rnc¶
RNC (Registro Nacional del Contribuyente, Dominican Republic tax number).
The RNC is the Dominican Republic taxpayer registration number for institutions. The number consists of 9 digits.
>>> validate('1-01-85004-3')
'101850043'
>>> validate('1018A0043')
Traceback (most recent call last):
...
InvalidFormat: ...
>>> validate('101850042')
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> format('131246796')
'1-31-24679-6'
-
stdnum.do.rnc.
calc_check_digit
(number)¶ Calculate the check digit.
-
stdnum.do.rnc.
compact
(number)¶ Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
-
stdnum.do.rnc.
format
(number)¶ Reformat the passed number to the standard format.
-
stdnum.do.rnc.
is_valid
(number)¶ Checks to see if the number provided is a valid RNC.
-
stdnum.do.rnc.
validate
(number)¶ Checks to see if the number provided is a valid RNC.