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

[QUESTION] I am trying to read a number in JSONReader with Feature.UseBigDecimalForDoubles , but when i get a String while parsing of "0E-18" i get it as double #2867

Closed
satrajitN1 opened this issue Aug 13, 2024 · 1 comment
Labels
fixed question Further information is requested
Milestone

Comments

@satrajitN1
Copy link

请描述您的问题

询问有关本项目的使用和其他方面的相关问题。

I am trying to read a number in JSONReader with Feature.UseBigDecimalForDoubles , but when i get a String while parsing of "0E-18" i get it as double, i Observed in the code in line

if (exponent != 0) {
String decimalStr = decimal.toPlainString();
return Double.parseDouble(
decimalStr + "E" + exponent);
}

that we are directly returning the double value , why is this a expected behaviour is there anyway while parsing i can force this to parse as BigDecimal ?

@satrajitN1 satrajitN1 added the question Further information is requested label Aug 13, 2024
@wenshao wenshao added the fixed label Sep 1, 2024
@wenshao wenshao added this to the 2.0.53 milestone Sep 1, 2024
@wenshao
Copy link
Member

wenshao commented Sep 16, 2024

@wenshao wenshao closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants