Skip to content

Validation of decimal values min and step values in number input - #427

Merged
rbri merged 1 commit into
HtmlUnit:masterfrom
thuri:HtmlNumberInputValidation
Dec 30, 2021
Merged

Validation of decimal values min and step values in number input#427
rbri merged 1 commit into
HtmlUnit:masterfrom
thuri:HtmlNumberInputValidation

Conversation

@thuri

@thuri thuri commented Dec 30, 2021

Copy link
Copy Markdown
Contributor

previous validation logic used double as type for the min, max and step
values of the number input.
But that datatype has potential precision issues especially when using
remainder (modulo) operation on it
(see https://stackoverflow.com/questions/3227342/modulus-with-doubles-in-java)

So the datatype is switched to BigDecimal which allows for exact
remainder calculations

previous validation logic used double as type for the min, max and step
values of the number input.
But that datatype has potential precision issues especially when using
remainder (modulo) operation on it
(see https://stackoverflow.com/questions/3227342/modulus-with-doubles-in-java)

So the datatype is switched to BigDecimal which allows for exact
remainder calculations
@thuri
thuri force-pushed the HtmlNumberInputValidation branch from ae31563 to 25f1b4d Compare December 30, 2021 14:27
@rbri
rbri merged commit a45714f into HtmlUnit:master Dec 30, 2021
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

Successfully merging this pull request may close these issues.

2 participants