Skip to content

[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

@satrajitN1

Description

@satrajitN1

请描述您的问题

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

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions