LanguageValues and typesStandard typesTax and identity numbers
UkUtr
On this page
A UK Unique Taxpayer Reference: ten digits.
Use it for someone's or a company's reference with HMRC. For National Insurance, use UkNationalInsuranceNumber. For a company at Companies House, use UkCompanyNumber.
Shape
One value, held as text in one set form, with no parts: 9876543210.
Example
UkUtr("1234567890")UkUtr(raw) checks the text, and text that isn't one breaks the format rule.
text.parse(raw, as: UkUtr) reads one from text that comes from outside. Text that isn't one at all fails malformed, such as 123456789, 12345 67890 or 12345678901.
Good to know
==tells you whether two are the same.<andlist.sort_bydon't take it.- A field that holds one counts as personal data (
government_id), so you don't mark it yourself.
In JSON
A string, in a request, a response or json.write:
"1234567890""9876543210"
Details
Text form, storage, how it is shown, and operations
UkUtr is in the group Tax and identity numbers, and has been in Jadpo since 0.1.0.
Text form
text.from writes one standard text form, the same form text.parse reads back: 1234567890 and 9876543210.
How it is stored
It is stored in one column named for the field, of type text. 9876543210 is stored as '9876543210'.
How it is shown to people
text.format(value, locale:) shows it to people in their locale.
With locale: Locale.en_gb:
| Value | Shown |
|---|---|
1234567890 |
1234567890 |
9876543210 |
9876543210 |
Operations
It also takes text.parse, text.from, text.format, json.read, json.write and ==. How every standard type behaves says how they work.
Markdown for agents: /docs/types/type-uk-utr.md.Built from Jadpo main at aee2e8f.