What to do If I have a big double and I want to output it into json document as a number like so 222222222.25 ?
I found many solutions but they all handle this as a string:
System.out.println("DOUBLE1: " + String.format("%.2f", 222222222.2502));
System.out.println("DOUBLE2: " + String.valueOf(new Double(String.format("%.2f", 222222222.2502))));
Output : DOUBLE1: 222222222.25 DOUBLE2: 2.2222222225E8
So what I want is to have the number 222222222.25 in json. How to do that?
I need to get the following using jackson: {value: 222222222.25} and not: {value: "222222222.25"}