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

Support decimalPlaces in the computed validation routine. #230

Open
chrisala opened this issue Feb 14, 2024 · 0 comments
Open

Support decimalPlaces in the computed validation routine. #230

chrisala opened this issue Feb 14, 2024 · 0 comments
Assignees

Comments

@chrisala
Copy link
Collaborator

Currently an expression based validator of the form:
{
"param": {
"expression": "totalSurveyBaseline",
"type": "computed"
},
"rule": "max"
}
is supported.

However, for a recent use case, we need the validation to compute the value to 3 decimal places as rounding down will cause an incorrect triggering of the max. e.g. the value evaluates to 0.083 which is rounded down to two decimal places at 0.08 meaning a (correct) set of values between 0.081-0.084 will be flagged as invalid due to rounding.

We should support a "decimalPlaces" field as used elsewhere:
{
"param": {
"expression": "totalSurveyBaseline",
"type": "computed",
"decimalPlaces":3
},
"rule": "max"
}

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