Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance each stdnum type with an example property #108

Open
ChrisWooldridge opened this issue Nov 14, 2023 · 2 comments
Open

Enhance each stdnum type with an example property #108

ChrisWooldridge opened this issue Nov 14, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@ChrisWooldridge
Copy link

It would be useful if each number type had an additional property 'example' that gives a compact form of the number. For example BR.cpf would have the property "39053344705" and AU.tfn would have '123456782' The example property for each type should validate (the data is already in each test case).
My use case is to generate a UI prompt. My AU.tfn prompt might be:
"Enter your TFN (e.g., 123 456 782)
An alternative use would be to generate an input mask. The BR.cpf example, above, would be formatted 390.533.447-05 which could then be used to create a mask:
####.###.###-##
(The creation of the mask is an exercise left to the user.)

@koblas
Copy link
Owner

koblas commented Nov 15, 2023

That's a pretty cool idea.

Some numbers have multiple formats or variations, so would require a list of formats, does that make sense to you?

I would probably borrow from the IBAN registry:

n = digits [0-9]
a = alphabetic [a-z]
c = character [a-z0-9]

That would make the brazil CPF have the format of: nnn.nnn.nnn-nn

@ChrisWooldridge
Copy link
Author

Your idea is better than my suggestion.

@koblas koblas added the enhancement New feature or request label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants