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

Use BigDecimal instead of Double in NumberFormat #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

georgewfraser
Copy link
Contributor

JSON can have number values outside the range of double. Also, it's important that multipleOf have an exact representation to be interpreted correctly. BigDecimal is better for these reasons.

@cowtowncoder
Copy link
Member

I can see why this could be an improvement, but it would also be a backwards-incompatible change, and possibly break existing code. Is there anything we could do to alleviate those problems? Otherwise simple upgrade of module to 2.7 (where this could be merged) could break existing deployments.

@georgewfraser
Copy link
Contributor Author

We could have two functions like:

private BigDecimal minimum;

public Double getMinimum() { ... }

@JsonIgnore
public BigDecimal getMinimumDecimal() { ... }

This would avoid breaking existing code, at the cost of carrying a little bit of legacy cruft forever.

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