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

Fix number comparisons when applying filters, BigDecimal handling #294

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

kohlschuetter
Copy link
Contributor

When comparing numbers in Jekyll flavor, comparisons would fail if a filter like "plus" was applied (e.g., "Cannot compare 1.0 with 0 because they are not the same type: java.lang.String vs java.math.BigDecimal").

This is due to premature BigDecimal-to-String conversion.

Introduce a BigDecimal subclass, PlainBigDecimal, whose toString() method calls toPlainString(), and defer toString() conversion as far as possible.

When comparing numbers in Jekyll flavor, comparisons would fail if a
filter like "plus" was applied (e.g., "Cannot compare 1.0 with 0 because
they are not the same type: java.lang.String vs java.math.BigDecimal").

This is due to premature BigDecimal-to-String conversion.

Introduce a BigDecimal subclass, PlainBigDecimal, whose toString()
method calls toPlainString(), and defer toString() conversion as far as
possible.
@msangel msangel merged commit 445b09b into bkiers:master Dec 27, 2023
4 checks passed
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