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

Questions about numberformat #7

Open
peterdesmet opened this issue Feb 2, 2017 · 2 comments
Open

Questions about numberformat #7

peterdesmet opened this issue Feb 2, 2017 · 2 comments
Assignees

Comments

@peterdesmet
Copy link
Member

  1. Does the format need to be a number, or is this also valid:
length:
  numberformat: .2   # test for "a.ab"
  1. Does the format need to be expressed in quotes?
length:
  numberformat: '.2'  # are the quotes necessary?
  1. Can the numberformat handle comma decimal points?
length:
  numberformat: ',2'  # test for "1,23"
  1. Can the numberformat handle more formats?
length:
  numberformat: '1,3.2'  # test for "1,000.00"
peterdesmet added a commit that referenced this issue Feb 2, 2017
@stijnvanhoey
Copy link
Contributor

stijnvanhoey commented Feb 2, 2017

I see two elements: (1) is it currently implemented in the validator and (2) do we want it - in general - as a whip specification

  1. # test for "a.ab". (1) no, the validator matches regex on numbers [0-9] only, (2) As the numberformat is called numberformat, I would keep it as such and not extend the support towards non-numbers.

  2. Does the format need to be expressed in quotes? (1) yes, otherwise the schema will not be valid (SchemaError: {'decimallatitude': [{'numberformat': ["must be of ['string'] type"]}]}(2) I would keep it as such, simplifies the yaml intepretation.

  3. Can the numberformat handle comma decimal points? (1) No, currently only dots support provided (2) if general good practice is to use dots for decimal number, I would stick to that and not extend support for bad practices.

  4. Can the numberformat handle more formats? (1) No, (2) If really on the wish-list, it could become an implementation requirement.

@peterdesmet
Copy link
Member Author

Ok for all points, but would be more consistent if quotes are not required. See all rules above numberformat: with or without quotes doesn't matter, except for regex, and the user is not aware that this is regex behind the scene.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants