-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
I am using jayway json-path - 2.4.0 to parse Json. When Parsing json, if the json contains any double value, its truncating the trailing zeros. For Example, I have a Json String like below.
{"name" : "Paddy" , "value": 60.10}
And my Code:
package com.test;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
import java.math.BigDecimal;
public class TestClas {
public static void main(String[] args) {
String value = "{\"name\" : \"Paddy\" , \"value\": 60.10}";
DocumentContext docCtx = JsonPath.parse(value);
JsonPath jsonPath = JsonPath.compile("$.value");
Object result = docCtx.read(jsonPath);
System.out.println(result);
}
}
And it just prints 60.1, but I need 60.10. How to get the result without truncating trailing zeros.
Metadata
Metadata
Assignees
Labels
No labels