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

Clean up the way decimal options are passed along #79

Open
faassen opened this issue Mar 14, 2019 · 0 comments
Open

Clean up the way decimal options are passed along #79

faassen opened this issue Mar 14, 2019 · 0 comments

Comments

@faassen
Copy link
Contributor

faassen commented Mar 14, 2019

Right now we have two ways to control decimal behavior:

  • decimalOptions, either a configuration object or a function that returns a configuration object given the context passed into the 'decimal' converter. This includes how many digits we want to accept, whether we want to allow zeroes and negative numbers.

  • TokenOptions/StateConverterOptions. This determines what the separators are for decimal rendering and whether we render thousands and are passed into the state and are accessed when we convert, render, etc.

Both offer run-time dynamism; the first gets this information from the context, whereas the second hardcodes this information along with the context.

We should unify these two mechanisms. That will make it easier to make number obey the same rules as decimal (right now some bits are hardcoded too). Which direction we should go in I'm not sure about yet. It can stand as a general mechanism for run-time control over the behavior of converters.

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

1 participant